@foblex/m-render 2.7.5 → 2.7.6

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.
@@ -1682,9 +1682,12 @@ class MarkdownService {
1682
1682
  .use(...new ParsePreviewGroup(this._provider?.getNavigation() || []).render())
1683
1683
  .use(...new ParseAngularExampleWithCodeLinks().render());
1684
1684
  }
1685
- parse(src) {
1685
+ parseUrl(src) {
1686
1686
  return this._httpClient.get(src, { responseType: 'text' }).pipe(take(1), catchError(() => of(''))).pipe(switchMap((text) => of(this._markdown.render(text))), switchMap((x) => of(this._cleanupEmptyParagraphs(x))), switchMap((x) => of(this._cleanupWasteParagraphFromExampleView(x))), switchMap((x) => of(this._cleanupWasteParagraphFromPreviewGroup(x))), switchMap((x) => of(this._normalizeLinks(x))), switchMap((x) => of(this._domSanitizer.bypassSecurityTrustHtml(x))));
1687
1687
  }
1688
+ parseText(value) {
1689
+ return of(this._markdown.render(value)).pipe(switchMap((x) => of(this._cleanupEmptyParagraphs(x))), switchMap((x) => of(this._cleanupWasteParagraphFromExampleView(x))), switchMap((x) => of(this._cleanupWasteParagraphFromPreviewGroup(x))), switchMap((x) => of(this._normalizeLinks(x))), switchMap((x) => of(this._domSanitizer.bypassSecurityTrustHtml(x))));
1690
+ }
1688
1691
  _normalizeLinks(html) {
1689
1692
  const currentPath = this._router.url;
1690
1693
  const prefix = currentPath.substring(0, currentPath.lastIndexOf('/'));
@@ -2718,7 +2721,7 @@ class FMarkdownRendererComponent {
2718
2721
  }
2719
2722
  _subscribeOnRouteChanges() {
2720
2723
  this._router.events
2721
- .pipe(startWith(null), debounceTime(50), switchMap(() => this._markdown.parse(this._provider.getMarkdownUrl(this._markdownPath))), tap((x) => this.value.set(x)), catchError((e, data) => {
2724
+ .pipe(startWith(null), debounceTime(50), switchMap(() => this._markdown.parseUrl(this._provider.getMarkdownUrl(this._markdownPath))), tap((x) => this.value.set(x)), catchError((e, data) => {
2722
2725
  console.error('[MarkdownRenderer] parse error:', e);
2723
2726
  return of(data);
2724
2727
  }), takeUntilDestroyed(this._destroyRef))