bugdown: Fix $$ whitespace handling.

The intended use of $$ is for inline expressions, not for multiline
ones; ```math is an acceptable alternative for the latter.  Hence,
the $$-syntax for inline TeX no longer permits newlines within it.

This was also necessary for the next change to be sensible; namely
allowing for spaces around both $$ when crafting inline TeX instead of
forcing everything to be crammed together, e.g. $$x=7$$.  In order to
avoid uninentionally creating inline expressions, the opening and
closing $$'s of an inline expression must now both exactly consist of
two dollar signs, no more and no less.

Fixes: #6488.
This commit is contained in:
Andy Perez
2017-11-03 09:15:14 +00:00
committed by Tim Abbott
parent b88ba90b30
commit 4d51a6cfac
4 changed files with 19 additions and 3 deletions

View File

@@ -519,7 +519,7 @@ inline.zulip = merge({}, inline.breaks, {
stream: /^#\*\*([^\*]+)\*\*/,
avatar: /^!avatar\(([^)]+)\)/,
gravatar: /^!gravatar\(([^)]+)\)/,
tex: /^(\$\$([^ _$](\\\$|[^$])*)(?! )\$\$)\B/,
tex: /^(\$\$([^\n_$](\\\$|[^\n$])*)\$\$(?!\$))\B/,
realm_filters: [],
text: replace(inline.breaks.text)
('|', '|(\ud83c[\udd00-\udfff]|\ud83d[\udc00-\ude4f]|' +
@@ -527,6 +527,7 @@ inline.zulip = merge({}, inline.breaks, {
'[\u2000-\u206F]|[\u2300-\u27BF]|[\u2B00-\u2BFF]|' +
'[\u3000-\u303F]|[\u3200-\u32FF])|')
(']|', '#@:]|')
('^[', '^^\\${3,}|^^[')
()
});