experimenting with quoting html chars in paths...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-11-30 21:02:51 +03:00
parent 901683bcca
commit ab5a3b216e
2 changed files with 14 additions and 2 deletions

View File

@ -94,6 +94,17 @@ module = {
quote: makeEncoder('quote', 'UNENCODED_PATH'),
unquote: makeDecoder('unquote', 'quote', 'UNENCODED_PATH'),
quoteHTML: function(str){
return str
.replace(/&/g, '&amp;')
.replace(/>/g, '&gt;')
.replace(/</g, '&lt;') },
unquoteHTML: function(str){
return str
.replace(/&amp;/g, '&')
.replace(/&gt;/g, '>')
.replace(/&lt;/g, '<') },
// Path utils...
//

View File

@ -38,9 +38,8 @@
*
*
*
* XXX parser: error handling: revise page quoting...
* ...need a standard mechanism to quote urls, url-args and paths...
* XXX BUG? can't use < and > (both?) in page title...
* ...can't seem to delete these pages -- seems to be a template problem...
* XXX parser: error handling: add line number + context... (???)
* XXX BUG: parser:
* This will break:
@ -266,6 +265,8 @@
* fixable (more general macro name pattern + ns matching) but I'm not
* sure if this is worth it
* ...see: <page>.defmacro(..)
* XXX parser: error handling: revise page quoting...
* ...need a standard mechanism to quote urls, url-args and paths...
* XXX sort: revise how we store order...
* .metadata.order = [ .. ]
* .metadata.order_<name> = [ .. ]