Allow escaping of '%' in templates
I'm using vim-zettel to manage my memex and would like to have notes start with '%title [%:description]'
I'm not sure if this breaks the org-mode spec, but having an escape key for % would be useful for my purposes. I know python but am still figuring out the code base currently, and RE is not my strong suit. Pointers on where to look to add escape characters to the RE parsing would be helpful. Line 66 in org_tools.py seems to be what I need to change?
Currently any text appended to '%' results in an error because it cannot find the variable.
Hi, seems that org-mode spec suggests using \% for escaping https://orgmode.org/manual/Template-expansion.html#FOOT87
Would that suit you?
You're right, this line is responsible for template expansion https://github.com/karlicoss/grasp/blob/master/server/org_tools.py#L67 I haven't tried, but I think you'd need something like py_template = re.sub(r'[^\\]%[:]?([?\w]+)', r'{\1}', org_template), so it excludes the \% from matching.
Yes, \% would suit me perfectly
Thanks for the regex, I will try changing the python and make a pull request if I'm successful :)
I think this works now :)