correct case where %20 decoded as space in auto link

correct case where onebox is not applied when url is decoded
This commit is contained in:
Sam
2017-07-03 16:32:53 -04:00
parent 340a3ee5cb
commit d2ba543ed3
3 changed files with 20 additions and 6 deletions

View File

@ -89,6 +89,12 @@ function renderHoisted(tokens, idx, options) {
}
}
function setupUrlDecoding(md) {
// this fixed a subtle issue where %20 is decoded as space in
// automatic urls
md.utils.lib.mdurl.decode.defaultChars = ';/?:@&=+$,# ';
}
function setupHoister(md) {
md.renderer.rules.html_raw = renderHoisted;
}
@ -152,6 +158,7 @@ export function setup(opts, siteSettings, state) {
typographer: siteSettings.enable_markdown_typographer
});
setupUrlDecoding(opts.engine);
setupHoister(opts.engine);
setupBlockBBCode(opts.engine);
setupInlineBBCode(opts.engine);