mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
More markdown compatibility fixes
* Escape " as " * Enable GFM newlines * Output a linebreak after <br> in the generated markup (imported from commit c007ec422054f9fc66a810b66aac70f70a2a1952)
This commit is contained in:
@@ -238,6 +238,7 @@ function escape(html, encode) {
|
|||||||
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
|
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
|
.replace(/"/g, '"')
|
||||||
.replace(/'/g, ''');
|
.replace(/'/g, ''');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,6 +341,11 @@ $(function () {
|
|||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Put a newline after a <br> in the generated HTML to match bugdown
|
||||||
|
r.br = function () {
|
||||||
|
return '<br>\n';
|
||||||
|
};
|
||||||
|
|
||||||
// Disable ordered lists
|
// Disable ordered lists
|
||||||
// We used GFM + tables, so replace the list start regex for that ruleset
|
// We used GFM + tables, so replace the list start regex for that ruleset
|
||||||
// We remove the |[\d+]\. that matches the numbering in a numbered list
|
// We remove the |[\d+]\. that matches the numbering in a numbered list
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ inline.zulip = merge({}, inline.breaks, {
|
|||||||
emoji: /^:([A-Za-z0-9_\-\+]+?):/,
|
emoji: /^:([A-Za-z0-9_\-\+]+?):/,
|
||||||
usermention: /^(@\*\*([^\*]+)?\*\*)/m,
|
usermention: /^(@\*\*([^\*]+)?\*\*)/m,
|
||||||
realm_filters: [],
|
realm_filters: [],
|
||||||
text: replace(inline.text)
|
text: replace(inline.breaks.text)
|
||||||
(']|', '@:]|')
|
(']|', '@:]|')
|
||||||
()
|
()
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user