lsms-worldbank / adodown

Tools for building Stata package documentation websites
https://lsms-worldbank.github.io/adodown/
5 stars 0 forks source link

ad_sthlp : Can't handle ` and ' on the same row. #6

Closed kbjarkefur closed 10 months ago

kbjarkefur commented 10 months ago

When rendering .sthlp files, ad_sthlp has a bug related to '

If inline code formatting is followed on the same line as ' then everything in-between the second ` and the ' will be interpreted as a local reference.

__**opt**ion1__(_string_) is used for `xyz`. Edits Stata's settings.

This should be solved by using macval() everywhere or somehow escape '. Probably escaping the character and replace it with {c 39}. ' has ASCII value 39.

Test for example:

di as smcl "[{c 39}]"
kbjarkefur commented 10 months ago

Solved and pushed to main.

Many characters are now escaped like this:

  local c : subinstr local c "'"   "{c 39}"
  local c : subinstr local c "$"   "{c S|}"
  local c : subinstr local c `"""' "{c 34}"
  local c : subinstr local c "{" "{c -(}"
  local c : subinstr local c "}" "{c )-}