croco-html 0.2.8 → 0.2.9
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.
- package/esm2020/lib/components/editor/image-editor/image-editor.component.mjs +2 -2
- package/esm2020/lib/components/editor/visual-editor/visual-editor.component.mjs +2 -2
- package/esm2020/lib/components/file-id-select/file-id-select.component.mjs +2 -2
- package/esm2020/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +3 -3
- package/esm2020/lib/extensions/BodyTagsExtensions.mjs +3 -3
- package/esm2020/lib/extensions/HtmlExtractionMethods.mjs +17 -17
- package/esm2020/lib/extensions/ImageMethods.mjs +15 -7
- package/esm2020/lib/extensions/TableMethods.mjs +5 -5
- package/esm2020/lib/pipes/ToHtmlBodyTagsPipe.mjs +2 -2
- package/esm2020/lib/pipes/to-preview.pipe.mjs +5 -2
- package/fesm2015/croco-html.mjs +46 -35
- package/fesm2015/croco-html.mjs.map +1 -1
- package/fesm2020/croco-html.mjs +46 -35
- package/fesm2020/croco-html.mjs.map +1 -1
- package/lib/extensions/BodyTagsExtensions.d.ts +2 -1
- package/lib/extensions/HtmlExtractionMethods.d.ts +20 -16
- package/lib/extensions/ImageMethods.d.ts +4 -3
- package/lib/extensions/TableMethods.d.ts +3 -2
- package/package.json +1 -1
|
@@ -3,7 +3,10 @@ import { HtmlExtractionMethods } from '../extensions/HtmlExtractionMethods';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export class ToPreviewPipe {
|
|
5
5
|
transform(value) {
|
|
6
|
-
return HtmlExtractionMethods.transformHtmlStringToBlocks(value
|
|
6
|
+
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
|
|
7
|
+
useCustomDomain: false,
|
|
8
|
+
domain: ""
|
|
9
|
+
});
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
12
|
ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -14,4 +17,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
14
17
|
name: 'topreview'
|
|
15
18
|
}]
|
|
16
19
|
}] });
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG8tcHJldmlldy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY3JvY28taHRtbC9zcmMvbGliL3BpcGVzL3RvLXByZXZpZXcucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQztBQUNwRCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQzs7QUFNNUUsTUFBTSxPQUFPLGFBQWE7SUFDeEIsU0FBUyxDQUFDLEtBQWE7UUFDckIsT0FBTyxxQkFBcUIsQ0FBQywyQkFBMkIsQ0FBQyxLQUFLLEVBQUU7WUFDOUQsZUFBZSxFQUFFLEtBQUs7WUFDdEIsTUFBTSxFQUFFLEVBQUU7U0FDWCxDQUFDLENBQUM7SUFDTCxDQUFDOzswR0FOVSxhQUFhO3dHQUFiLGFBQWE7MkZBQWIsYUFBYTtrQkFIekIsSUFBSTttQkFBQztvQkFDSixJQUFJLEVBQUUsV0FBVztpQkFDbEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQaXBlLCBQaXBlVHJhbnNmb3JtIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IEh0bWxFeHRyYWN0aW9uTWV0aG9kcyB9IGZyb20gJy4uL2V4dGVuc2lvbnMvSHRtbEV4dHJhY3Rpb25NZXRob2RzJztcclxuaW1wb3J0IHsgSW50ZXJmYWNlQmxvY2sgfSBmcm9tIFwiLi4vZXh0ZW5zaW9ucy9JbnRlcmZhY2VCbG9ja1wiO1xyXG5cclxuQFBpcGUoe1xyXG4gIG5hbWU6ICd0b3ByZXZpZXcnXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBUb1ByZXZpZXdQaXBlIGltcGxlbWVudHMgUGlwZVRyYW5zZm9ybSB7XHJcbiAgdHJhbnNmb3JtKHZhbHVlOiBzdHJpbmcpOiBJbnRlcmZhY2VCbG9ja1tdIHtcclxuICAgIHJldHVybiBIdG1sRXh0cmFjdGlvbk1ldGhvZHMudHJhbnNmb3JtSHRtbFN0cmluZ1RvQmxvY2tzKHZhbHVlLCB7XHJcbiAgICAgIHVzZUN1c3RvbURvbWFpbjogZmFsc2UsXHJcbiAgICAgIGRvbWFpbjogXCJcIlxyXG4gICAgfSk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
package/fesm2015/croco-html.mjs
CHANGED
|
@@ -74,15 +74,23 @@ class FileImageTagDataConsts {
|
|
|
74
74
|
FileImageTagDataConsts.TagName = "file-image";
|
|
75
75
|
FileImageTagDataConsts.FileIdAttrName = "file-id";
|
|
76
76
|
class ImageMethods {
|
|
77
|
-
static buildUrl(fileId) {
|
|
78
|
-
|
|
77
|
+
static buildUrl(fileId, options) {
|
|
78
|
+
var baseUrl = `/FileCopies/Images/Medium/${fileId}.jpg`;
|
|
79
|
+
if (!options.useCustomDomain) {
|
|
80
|
+
return baseUrl;
|
|
81
|
+
}
|
|
82
|
+
return `${options.domain}${baseUrl}`;
|
|
79
83
|
}
|
|
80
|
-
static buildSmallUrl(fileId) {
|
|
81
|
-
|
|
84
|
+
static buildSmallUrl(fileId, options) {
|
|
85
|
+
var baseUrl = `/FileCopies/Images/Small/${fileId}.jpg`;
|
|
86
|
+
if (!options.useCustomDomain) {
|
|
87
|
+
return baseUrl;
|
|
88
|
+
}
|
|
89
|
+
return `${options.domain}${baseUrl}`;
|
|
82
90
|
}
|
|
83
|
-
static ExtractImage(elem) {
|
|
91
|
+
static ExtractImage(elem, options) {
|
|
84
92
|
let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
|
|
85
|
-
let src = ImageMethods.buildUrl(fileId);
|
|
93
|
+
let src = ImageMethods.buildUrl(fileId, options);
|
|
86
94
|
return {
|
|
87
95
|
type: FileImageTagDataConsts.TagName,
|
|
88
96
|
data: {
|
|
@@ -378,7 +386,7 @@ class FileIdSelectComponent {
|
|
|
378
386
|
this.onFileIdChanged.emit(fileId);
|
|
379
387
|
}
|
|
380
388
|
getSrc(fileId) {
|
|
381
|
-
return ImageMethods.buildSmallUrl(fileId);
|
|
389
|
+
return ImageMethods.buildSmallUrl(fileId, { useCustomDomain: false, domain: "" });
|
|
382
390
|
}
|
|
383
391
|
ngOnInit() {
|
|
384
392
|
this.loadFiles();
|
|
@@ -428,7 +436,7 @@ class ImageEditorComponent {
|
|
|
428
436
|
this.onTagUpdated = new EventEmitter();
|
|
429
437
|
}
|
|
430
438
|
getSrc() {
|
|
431
|
-
return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
|
|
439
|
+
return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], { useCustomDomain: false, domain: "" });
|
|
432
440
|
}
|
|
433
441
|
hasFileId() {
|
|
434
442
|
return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
|
|
@@ -516,10 +524,10 @@ class XmlTagViewComponent {
|
|
|
516
524
|
}
|
|
517
525
|
}
|
|
518
526
|
XmlTagViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
519
|
-
XmlTagViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === '
|
|
527
|
+
XmlTagViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { kind: "component", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
520
528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, decorators: [{
|
|
521
529
|
type: Component,
|
|
522
|
-
args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === '
|
|
530
|
+
args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
|
|
523
531
|
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
524
532
|
type: Input
|
|
525
533
|
}] } });
|
|
@@ -737,10 +745,10 @@ TableTypes.TableRowColumnData = "table-row-column-data";
|
|
|
737
745
|
TableTypes.Table = "table";
|
|
738
746
|
TableTypes.TableRowColumn = "table-row-column";
|
|
739
747
|
class TableMethods {
|
|
740
|
-
static getTableFromHtmlTag(tableTag) {
|
|
748
|
+
static getTableFromHtmlTag(tableTag, options) {
|
|
741
749
|
let tableData = {
|
|
742
750
|
header: TableMethods.getHeader(tableTag),
|
|
743
|
-
rows: TableMethods.getTableRows(tableTag)
|
|
751
|
+
rows: TableMethods.getTableRows(tableTag, options)
|
|
744
752
|
};
|
|
745
753
|
var result = {
|
|
746
754
|
type: TableTypes.Table,
|
|
@@ -794,7 +802,7 @@ class TableMethods {
|
|
|
794
802
|
columns: headerColumns
|
|
795
803
|
};
|
|
796
804
|
}
|
|
797
|
-
static getTableRows(tableTag) {
|
|
805
|
+
static getTableRows(tableTag, options) {
|
|
798
806
|
let tBody = tableTag.tBodies.item(0);
|
|
799
807
|
let rows = [];
|
|
800
808
|
for (let i = 0; i < tBody.children.length; i++) {
|
|
@@ -802,7 +810,7 @@ class TableMethods {
|
|
|
802
810
|
let rowColumns = [];
|
|
803
811
|
for (let j = 0; j < iElement.children.length; j++) {
|
|
804
812
|
const jElement = iElement.children.item(j);
|
|
805
|
-
let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
|
|
813
|
+
let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement, options);
|
|
806
814
|
if (children.length === 0) {
|
|
807
815
|
var textTag = document.createElement("p");
|
|
808
816
|
textTag.innerHTML = jElement.innerHTML;
|
|
@@ -862,7 +870,7 @@ class HtmlExtractionMethods {
|
|
|
862
870
|
data.type = tagName;
|
|
863
871
|
return data;
|
|
864
872
|
}
|
|
865
|
-
static transformHtmlElementToBlocks(element) {
|
|
873
|
+
static transformHtmlElementToBlocks(element, options) {
|
|
866
874
|
var data = [];
|
|
867
875
|
for (let i = 0; i < element.children.length; i++) {
|
|
868
876
|
var elem = element.children.item(i);
|
|
@@ -876,13 +884,13 @@ class HtmlExtractionMethods {
|
|
|
876
884
|
}
|
|
877
885
|
else {
|
|
878
886
|
var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
|
|
879
|
-
var result = extractor(elem);
|
|
887
|
+
var result = extractor(elem, options);
|
|
880
888
|
data.push(result);
|
|
881
889
|
}
|
|
882
890
|
}
|
|
883
891
|
return data;
|
|
884
892
|
}
|
|
885
|
-
static transformHtmlStringToBlocks(value) {
|
|
893
|
+
static transformHtmlStringToBlocks(value, options) {
|
|
886
894
|
if (value === undefined) {
|
|
887
895
|
return [];
|
|
888
896
|
}
|
|
@@ -891,27 +899,27 @@ class HtmlExtractionMethods {
|
|
|
891
899
|
.replace('\t', '');
|
|
892
900
|
var div = document.createElement("div");
|
|
893
901
|
div.innerHTML = value;
|
|
894
|
-
return this.transformHtmlElementToBlocks(div);
|
|
902
|
+
return this.transformHtmlElementToBlocks(div, options);
|
|
895
903
|
}
|
|
896
904
|
}
|
|
897
905
|
HtmlExtractionMethods.Extractors = {
|
|
898
|
-
["TEXT"]: (elem) => TextSimpleMethods.ExtractTextTag(elem),
|
|
899
|
-
["FILE-IMAGE"]: (elem) => ImageMethods.ExtractImage(elem),
|
|
900
|
-
["TABLE"]: (elem) => TableMethods.getTableFromHtmlTag(elem),
|
|
901
|
-
["RICH-TEXT"]: (elem) => TextMethods.ExtractRichTextData(elem),
|
|
902
|
-
["HTML-RAW"]: (elem) => ({
|
|
906
|
+
["TEXT"]: (elem, options) => TextSimpleMethods.ExtractTextTag(elem),
|
|
907
|
+
["FILE-IMAGE"]: (elem, options) => ImageMethods.ExtractImage(elem, options),
|
|
908
|
+
["TABLE"]: (elem, options) => TableMethods.getTableFromHtmlTag(elem, options),
|
|
909
|
+
["RICH-TEXT"]: (elem, options) => TextMethods.ExtractRichTextData(elem),
|
|
910
|
+
["HTML-RAW"]: (elem, options) => ({
|
|
903
911
|
type: "html-raw",
|
|
904
912
|
data: {
|
|
905
913
|
innerHTML: elem.innerHTML
|
|
906
914
|
}
|
|
907
915
|
}),
|
|
908
|
-
["H1"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
|
|
909
|
-
["H2"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
|
|
910
|
-
["H3"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
|
|
911
|
-
["H4"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
|
|
912
|
-
["H5"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
|
|
913
|
-
["H6"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
|
|
914
|
-
[ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem) => VideoMethods.ExtractExternalVideoTag(elem)
|
|
916
|
+
["H1"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
|
|
917
|
+
["H2"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
|
|
918
|
+
["H3"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
|
|
919
|
+
["H4"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
|
|
920
|
+
["H5"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
|
|
921
|
+
["H6"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
|
|
922
|
+
[ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem, options) => VideoMethods.ExtractExternalVideoTag(elem)
|
|
915
923
|
};
|
|
916
924
|
|
|
917
925
|
class HtmlRawTagDataConsts {
|
|
@@ -962,8 +970,8 @@ class BodyTagsExtensions {
|
|
|
962
970
|
}
|
|
963
971
|
return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
|
|
964
972
|
}
|
|
965
|
-
static getBodyTags(html) {
|
|
966
|
-
let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
|
|
973
|
+
static getBodyTags(html, options) {
|
|
974
|
+
let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
|
|
967
975
|
return result.map(x => BodyTagsExtensions.toBodyTag(x));
|
|
968
976
|
}
|
|
969
977
|
static sanitizeInnerHtml(html) {
|
|
@@ -1221,7 +1229,7 @@ class VisualEditorComponent {
|
|
|
1221
1229
|
this.onHtmlChanged.emit(this.html);
|
|
1222
1230
|
}
|
|
1223
1231
|
recalculateBodyTags() {
|
|
1224
|
-
this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
|
|
1232
|
+
this.bodyTags = BodyTagsExtensions.getBodyTags(this.html, { useCustomDomain: false, domain: "" });
|
|
1225
1233
|
}
|
|
1226
1234
|
ngOnInit() {
|
|
1227
1235
|
this.recalculateBodyTags();
|
|
@@ -1250,7 +1258,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1250
1258
|
|
|
1251
1259
|
class ToPreviewPipe {
|
|
1252
1260
|
transform(value) {
|
|
1253
|
-
return HtmlExtractionMethods.transformHtmlStringToBlocks(value
|
|
1261
|
+
return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
|
|
1262
|
+
useCustomDomain: false,
|
|
1263
|
+
domain: ""
|
|
1264
|
+
});
|
|
1254
1265
|
}
|
|
1255
1266
|
}
|
|
1256
1267
|
ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -1395,7 +1406,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1395
1406
|
|
|
1396
1407
|
class ToHtmlBodyTagsPipe {
|
|
1397
1408
|
transform(value) {
|
|
1398
|
-
return BodyTagsExtensions.getBodyTags(value);
|
|
1409
|
+
return BodyTagsExtensions.getBodyTags(value, { useCustomDomain: false, domain: "" });
|
|
1399
1410
|
}
|
|
1400
1411
|
}
|
|
1401
1412
|
ToHtmlBodyTagsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|