(core) Treat URLs in Markdown cells as absolute

Summary: The previous behavior didn't match HyperLink cells.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Subscribers: jarek

Differential Revision: https://phab.getgrist.com/D4358
This commit is contained in:
George Gevoian
2024-09-30 12:34:35 -04:00
parent d2714da224
commit 1927c87413
2 changed files with 5 additions and 4 deletions

View File

@@ -1,10 +1,11 @@
import {constructUrl} from 'app/client/models/gristUrlState';
import {gristIconLink} from 'app/client/ui2018/links';
import escape from 'lodash/escape';
import {marked} from 'marked';
export const renderer = new marked.Renderer();
renderer.link = ({href, text}) => gristIconLink(href, text).outerHTML;
renderer.link = ({href, text}) => gristIconLink(constructUrl(href), text).outerHTML;
// Disable Markdown features that we aren't ready to support yet.
renderer.hr = ({raw}) => raw;