Skip to content

Matching sub and super script at the start of a line #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ispringle opened this issue Sep 16, 2022 · 2 comments · Fixed by #127
Closed

Matching sub and super script at the start of a line #51

ispringle opened this issue Sep 16, 2022 · 2 comments · Fixed by #127

Comments

@ispringle
Copy link
Contributor

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.

public subsuperscriptRe(): RegExp {

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.

@rasendubi
Copy link
Owner

 ^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
Copy link
Owner

I have added test cases to make sure that zero-width spaces are allowed before sub/superscripts (#127). They pass successfully, so I'm going to close this issue. Adding zwsp at the start of the line is the recommended way to to get sub/superscripts working. Let me know if that's not what you had in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants