Skip to content
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

Keep track of "^" symbol when within footnotes #274

Merged
merged 4 commits into from
Jan 25, 2023
Merged

Conversation

gjtorikian
Copy link
Collaborator

Should close #106.

I haven't quite figured out how the parser should "write" to the resulting string, hence the draft state. Ideally the diff looks something like:

diff --git a/src/parser/inlines.rs b/src/parser/inlines.rs
index 28a1235..4732464 100644
--- a/src/parser/inlines.rs
+++ b/src/parser/inlines.rs
@@ -149,7 +149,22 @@ impl<'a, 'r, 'o, 'd, 'i, 'c, 'subj> Subject<'a, 'r, 'o, 'd, 'i, 'c, 'subj> {
                 }
             }
             '~' if self.options.extension.strikethrough => Some(self.handle_delim(b'~')),
-            '^' if self.options.extension.superscript => Some(self.handle_delim(b'^')),
+            '^' if self.options.extension.superscript => {
+                if !self.within_brackets {
+                    Some(self.handle_delim(b'^'))
+                } else {
+                    // something
+               }

@gjtorikian gjtorikian self-assigned this Jan 23, 2023
@gjtorikian gjtorikian marked this pull request as ready for review January 25, 2023 00:52
@gjtorikian
Copy link
Collaborator Author

xref gjtorikian/commonmarker#217 fyi @DannyBen

@kivikakk
Copy link
Owner

Awesome — thank you!

@kivikakk kivikakk merged commit 7759912 into main Jan 25, 2023
@kivikakk kivikakk deleted the super-footnote branch January 25, 2023 02:56
@gjtorikian
Copy link
Collaborator Author

Would it be possible to cut a new release with this? Thank you!

kivikakk added a commit to digitalmoksha/comrak that referenced this pull request Jan 25, 2023
@kivikakk
Copy link
Owner

Of course — underway.

kivikakk added a commit to digitalmoksha/comrak that referenced this pull request Jan 25, 2023
@kivikakk
Copy link
Owner

This is 0.16.0 on crates.io!

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 this pull request may close these issues.

footnotes plus superscript interact weirdly
2 participants