Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Debug cannot import footnote from hash #2441
Debug cannot import footnote from hash #2441
Changes from 13 commits
22b9289
8b3cc6d
c7d4915
168dd4c
f285220
eecebc2
a68e82a
52c316d
1f9dce4
6a441b3
a65218a
e77a7bc
bd50434
1e8a14e
3146481
003eeb7
53e3147
1b9f432
db02850
9620126
54cc49f
72168e0
d555215
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh also small thing but i was wondering if using cheerio here makes more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emm, but is not to use cheerio, we need the exact id (eg:
#${href}.footnote-item
)? So we still need to pattern matching (and also to replace the index in the original content).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I get that cheerio will do the same thing but I think its cleaner to use cheerio to select out and append. In that case, we can use cheerio node to do the modifications below as well. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yucheng11122017
Thank you for the clarification; I have explored cheerio apis and made the requested changes. Following is a quick snapshot:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(console.log on last line was removed in later commits)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to do this replace here? Why are you changing the number for the footnote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have improved this with the following changes:
where the default value is:
last modification:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation being, as this initially is to fix the error in display footnote in the user doc, I decided to be defensive and do the best (without going beyond the scope and making changes outside the
hash
part) to strive for making importing footnote from a single hash look good.