uniorg icon indicating copy to clipboard operation
uniorg copied to clipboard

Matching sub and super script at the start of a line

Open ispringle opened this issue 3 years ago • 1 comments

In orgmode a superscript or subscript cannot be the first char in a line. To resolve this, you have to stick a U+FEFF (C-x 8 RET zero width no-break space RET) before the super/sub.

https://github.com/rasendubi/uniorg/blob/c6fdf0db0e2e4372c8125636d291a55ef2861cb9/packages/uniorg-parse/src/utils.ts#L135

I can think of two or three resolutions. One option would be to explicitly allow super/sub in the #+OPTIONS property, then have uniorg look for this and if the option is set it would interpret all instances of ^:{} (or whatever is set) as a super/sub. This would have the added benefit of not turning snack_case_outside_of_code. I poked at the regexp but it's beyond me at the moment, might look again later though.

ispringle avatar Sep 16 '22 14:09 ispringle

 ^super is supposed to be working already. The issue is likely caused by \S regex in JS not capturing   (rightfully), while Emacs' \S- does.

rasendubi avatar Sep 21 '22 12:09 rasendubi