From e1690c6f1a98ba9bcb489f9681a73690df6b4f3c Mon Sep 17 00:00:00 2001 From: ClemDee Date: Wed, 24 Jul 2019 15:27:10 +0200 Subject: [PATCH] Escape titles inside links for Code and Slide titles --- www/common/sframe-common-codemirror.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 8a0e2de63..eb2298e3d 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -98,7 +98,15 @@ define([ // lines beginning with a hash are potentially valuable // works for markdown, python, bash, etc. var hash = /^#+(.*?)$/; + var hashAndLink = /^#+\s*\[(.*?)\]\(.*\)\s*$/; if (hash.test(line)) { + // test for link inside the title, and set text just to the name of the link + if (hashAndLink.test(line)) { + line.replace(hashAndLink, function (a, one) { + text = one; + }); + return true; + } line.replace(hash, function (a, one) { text = one; });