tnx-shared 5.3.232 → 5.3.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54328,6 +54328,7 @@
54328
54328
  this.content = '';
54329
54329
  this.id = '';
54330
54330
  this.id = this._commonService.guid();
54331
+ this.loadMathConfig();
54331
54332
  }
54332
54333
  // ngOnChanges(changes: SimpleChanges) {
54333
54334
  // if (changes['content']) {
@@ -54360,28 +54361,36 @@
54360
54361
  var $this = _this;
54361
54362
  var autoScrollBottom = !!((_a = $this.control) === null || _a === void 0 ? void 0 : _a.autoScrollBottom);
54362
54363
  var output = $this.mathContent.nativeElement;
54363
- output.innerHTML = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
54364
- $this.mathJaxObject.texReset();
54365
- $this.mathJaxObject.typesetClear();
54366
- $this.mathJaxObject.typesetPromise([output]).catch(function (err) {
54367
- output.innerHTML = '';
54368
- output.appendChild(document.createTextNode(err.message));
54369
- console.error(err);
54370
- }).then(function () {
54371
- var _a, _b, _c;
54372
- // Do something after typeset
54373
- if (autoScrollBottom) {
54374
- var box = document.querySelector("#math-preview-box-" + $this.id);
54375
- var elem = box.getElementsByClassName('ps--active-y')[0];
54376
- if (elem) {
54377
- elem.scrollTop = elem.scrollHeight;
54378
- }
54379
- }
54380
- var value = (_c = (_b = (_a = document.getElementById("mathPreview-" + $this.id)) === null || _a === void 0 ? void 0 : _a.innerHTML) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
54381
- $this.onChange(value);
54382
- $this.onChanged.emit(value);
54383
- });
54384
- return _this.mathJaxObject.startup.defaultPageReady();
54364
+ var content = ((_b = $this.content) === null || _b === void 0 ? void 0 : _b.trim()) || '';
54365
+ content = content.replace(/\n/g, '<br>');
54366
+ output.innerHTML = content;
54367
+ if ($this.mathJaxObject.texReset) {
54368
+ $this.mathJaxObject.texReset();
54369
+ }
54370
+ if ($this.mathJaxObject.typesetClear) {
54371
+ $this.mathJaxObject.typesetClear();
54372
+ }
54373
+ if ($this.mathJaxObject.typesetPromise) {
54374
+ $this.mathJaxObject.typesetPromise([output]).catch(function (err) {
54375
+ output.innerHTML = '';
54376
+ output.appendChild(document.createTextNode(err.message));
54377
+ console.error(err);
54378
+ }).then(function () {
54379
+ var _a, _b, _c;
54380
+ // Do something after typeset
54381
+ if (autoScrollBottom) {
54382
+ var box = document.querySelector("#math-preview-box-" + $this.id);
54383
+ var elem = box.getElementsByClassName('ps--active-y')[0];
54384
+ if (elem) {
54385
+ elem.scrollTop = elem.scrollHeight;
54386
+ }
54387
+ }
54388
+ var value = (_c = (_b = (_a = document.getElementById("mathPreview-" + $this.id)) === null || _a === void 0 ? void 0 : _a.innerHTML) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : '';
54389
+ $this.onChange(value);
54390
+ $this.onChanged.emit(value);
54391
+ });
54392
+ }
54393
+ return $this.mathJaxObject.startup.defaultPageReady ? $this.mathJaxObject.startup.defaultPageReady() : $this.mathJaxObject.startup.defaultPageReady;
54385
54394
  });
54386
54395
  };
54387
54396
  HtmlPreviewComponent.prototype.loadMathConfig = function () {
@@ -54437,7 +54446,6 @@
54437
54446
  document.head.appendChild(script);
54438
54447
  };
54439
54448
  HtmlPreviewComponent.prototype.ngOnInit = function () {
54440
- this.loadMathConfig();
54441
54449
  };
54442
54450
  return HtmlPreviewComponent;
54443
54451
  }());