PrimeNG编辑器数学公式

时间:2017-01-05 15:56:18

标签: primeng

我有一个简单的数学公式,我需要使用公式按钮在编辑器上显示。

我的公式: {a^2 + b^2}

当我尝试给它时,会收到错误:

EXCEPTION: [Parchment] Unable to create formula blot
    ErrorHandler</ErrorHandler.prototype.handleError http://localhost:8080/prod/vendor.js:31109:14
    PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/</<.next http://localhost:8080/prod/vendor.js:36067:70
    EventEmitter</EventEmitter.prototype.subscribe/schedulerFn< http://localhost:8080/prod/vendor.js:31736:41
    SafeSubscriber</SafeSubscriber.prototype.__tryOrUnsub http://localhost:8080/prod/vendor.js:41339:14
    SafeSubscriber</SafeSubscriber.prototype.next http://localhost:8080/prod/vendor.js:41288:18
    Subscriber</Subscriber.prototype._next http://localhost:8080/prod/vendor.js:41241:10
    Subscriber</Subscriber.prototype.next http://localhost:8080/prod/vendor.js:41205:14
    Subject</Subject.prototype.next http://localhost:8080/prod/vendor.js:40828:18
    EventEmitter</EventEmitter.prototype.emit http://localhost:8080/prod/vendor.js:31722:59
    NgZone</NgZone.prototype.triggerError http://localhost:8080/prod/vendor.js:32083:61
    NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onHandleError http://localhost:8080/prod/vendor.js:32044:22
    ZoneDelegate.prototype.handleError http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:196:19
    Zone.prototype.runTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:128:25
    ZoneTask/this.invoke http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:293:28

ORIGINAL STACKTRACE:
    ErrorHandler</ErrorHandler.prototype.handleError http://localhost:8080/prod/vendor.js:31114:18
    PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/</<.next http://localhost:8080/prod/vendor.js:36067:70
    EventEmitter</EventEmitter.prototype.subscribe/schedulerFn< http://localhost:8080/prod/vendor.js:31736:41
    SafeSubscriber</SafeSubscriber.prototype.__tryOrUnsub http://localhost:8080/prod/vendor.js:41339:14
    SafeSubscriber</SafeSubscriber.prototype.next http://localhost:8080/prod/vendor.js:41288:18
    Subscriber</Subscriber.prototype._next http://localhost:8080/prod/vendor.js:41241:10
    Subscriber</Subscriber.prototype.next http://localhost:8080/prod/vendor.js:41205:14
    Subject</Subject.prototype.next http://localhost:8080/prod/vendor.js:40828:18
    EventEmitter</EventEmitter.prototype.emit http://localhost:8080/prod/vendor.js:31722:59
    NgZone</NgZone.prototype.triggerError http://localhost:8080/prod/vendor.js:32083:61
    NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onHandleError http://localhost:8080/prod/vendor.js:32044:22
    ZoneDelegate.prototype.handleError http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:196:19
    Zone.prototype.runTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:128:25
    ZoneTask/this.invoke http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:293:28

e@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:13845
n@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:12290
l</e.prototype.insertAt@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:25329
j</<.value@http://localhost:8080/node_modules/quill/dist/quill.min.js:9:4946
s</e.prototype.insertAt@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:5404
s</e.prototype.insertAt@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:21442
x</<.value@http://localhost:8080/node_modules/quill/dist/quill.min.js:10:5543
q</<.value@http://localhost:8080/node_modules/quill/dist/quill.min.js:8:27444
S</<.value/<@http://localhost:8080/node_modules/quill/dist/quill.min.js:8:5320
a@http://localhost:8080/node_modules/quill/dist/quill.min.js:7:29623
S</<.value@http://localhost:8080/node_modules/quill/dist/quill.min.js:8:5290
L</<.value@http://localhost:8080/node_modules/quill/dist/quill.min.js:13:4073
x</<.value/<@http://localhost:8080/node_modules/quill/dist/quill.min.js:13:7726
ZoneDelegate.prototype.invokeTask@http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:225:23
NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@http://localhost:8080/prod/vendor.js:32014:33
ZoneDelegate.prototype.invokeTask@http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:224:23
Zone.prototype.runTask@http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:125:28
ZoneTask/this.invoke@http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:293:28

    ErrorHandler</ErrorHandler.prototype.handleError http://localhost:8080/prod/vendor.js:31115:18
    PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/</<.next http://localhost:8080/prod/vendor.js:36067:70
    EventEmitter</EventEmitter.prototype.subscribe/schedulerFn< http://localhost:8080/prod/vendor.js:31736:41
    SafeSubscriber</SafeSubscriber.prototype.__tryOrUnsub http://localhost:8080/prod/vendor.js:41339:14
    SafeSubscriber</SafeSubscriber.prototype.next http://localhost:8080/prod/vendor.js:41288:18
    Subscriber</Subscriber.prototype._next http://localhost:8080/prod/vendor.js:41241:10
    Subscriber</Subscriber.prototype.next http://localhost:8080/prod/vendor.js:41205:14
    Subject</Subject.prototype.next http://localhost:8080/prod/vendor.js:40828:18
    EventEmitter</EventEmitter.prototype.emit http://localhost:8080/prod/vendor.js:31722:59
    NgZone</NgZone.prototype.triggerError http://localhost:8080/prod/vendor.js:32083:61
    NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onHandleError http://localhost:8080/prod/vendor.js:32044:22
    ZoneDelegate.prototype.handleError http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:196:19
    Zone.prototype.runTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:128:25
    ZoneTask/this.invoke http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:293:28

Error: [Parchment] Unable to create formula blot

    e http://localhost:8080/node_modules/quill/dist/quill.min.js:7:13845
    n http://localhost:8080/node_modules/quill/dist/quill.min.js:7:12290
    l</e.prototype.insertAt http://localhost:8080/node_modules/quill/dist/quill.min.js:7:25329
    j</<.value http://localhost:8080/node_modules/quill/dist/quill.min.js:9:4946
    s</e.prototype.insertAt http://localhost:8080/node_modules/quill/dist/quill.min.js:7:5404
    s</e.prototype.insertAt http://localhost:8080/node_modules/quill/dist/quill.min.js:7:21442
    x</<.value http://localhost:8080/node_modules/quill/dist/quill.min.js:10:5543
    q</<.value http://localhost:8080/node_modules/quill/dist/quill.min.js:8:27444
    S</<.value/< http://localhost:8080/node_modules/quill/dist/quill.min.js:8:5320
    a http://localhost:8080/node_modules/quill/dist/quill.min.js:7:29623
    S</<.value http://localhost:8080/node_modules/quill/dist/quill.min.js:8:5290
    L</<.value http://localhost:8080/node_modules/quill/dist/quill.min.js:13:4073
    x</<.value/< http://localhost:8080/node_modules/quill/dist/quill.min.js:13:7726
    ZoneDelegate.prototype.invokeTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:225:23
    NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask http://localhost:8080/prod/vendor.js:32014:33
    ZoneDelegate.prototype.invokeTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:224:23
    Zone.prototype.runTask http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:125:28
    ZoneTask/this.invoke http://localhost:8080/resources/js/libs/angular/zone.0.6.21.js:293:28

的index.html

<link rel="stylesheet" type="text/css" href="/node_modules/katex/dist/katex.min.css" />
<script type="text/javascript" src="/node_modules/katex/dist/katex.min.js"></script>

<script src="node_modules/quill/dist/quill.min.js"></script>

组件

import { Component } from '@angular/core';

@Component({
    template: `
        <p-editor [(ngModel)]="text" [style]="{'height':'150px'}">
            <header>
                <span class="ql-formats">
                    <button class="ql-formula"></button>
                </span>
            </header>
        </p-editor>
    `
})
export class EmptyDemo {

    text: string;

    constructor() { }
}

版本: Katex 0.6.0, 羽毛笔1.1.9, PrimeNG 1.1.3

我该如何解决这个问题?

0 个答案:

没有答案