mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Add a quick html entity decoding hack, and document need for general decoder.
This commit is contained in:
parent
d00743ad79
commit
0ce1e9fcf3
|
@ -393,7 +393,9 @@ text = t:text_char+ { return t.join(''); }
|
|||
* } end of parser func/transclusion/template arg
|
||||
*/
|
||||
|
||||
urltext = ( t:[^'<~[{\n\rfghimnstw:\]} ]+ { return t.join(''); }
|
||||
urltext = ( t:[^'<~[{\n\rfghimnstw:\]} &]+ { return t.join(''); }
|
||||
// XXX: use general entity decode!
|
||||
/ "&" { return "&"; } // decode ampersand in text
|
||||
/ urllink
|
||||
// Convert trailing space into
|
||||
// XXX: This should be moved to a serializer
|
||||
|
@ -743,8 +745,11 @@ unicode_separator_space = [ \u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]
|
|||
|
||||
url
|
||||
= proto:url_protocol
|
||||
rest:( [^ :\]\[\n<>\x00-\x20\x7f,.]
|
||||
/ s:[.:,] !(space / eolf) { return s } )+
|
||||
rest:( [^ :\]\[\n<>\x00-\x20\x7f,.&]
|
||||
/ s:[.:,] !(space / eolf) { return s }
|
||||
// XXX: use general entity decode!
|
||||
/ '&' { return '&' }
|
||||
/ '&' )+
|
||||
{
|
||||
return proto + rest.join('');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue