-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for phrasing content #58
Conversation
@d4rekanguok here’s how I’d do it. Could you check? The slugs/URLs aren’t perfect, though. And they’re different from GitHub. Although this has always been a problem, so it isn’t new. |
I tested it out & it worked great!! Can't wait to see this get merged. Thank you again for the swift response. |
var index = -1 | ||
|
||
while (++index < length) { | ||
result = result.concat(one(children[index])) |
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.
One option could be to only copy text
nodes
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.
Hmm... that gets tricky for image
nodes and the like..
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.
Without doing too much to turn other nodes into text nodes, this is probably the simplest approach
Pretty sure this won't introduce any breaking changes either?
Otherwise, this looks good 👍
Thanks for reviewing both! @BarryThePenguin This will definitely break things! Potentially for the better. |
@BarryThePenguin What do you think re my previous comment? |
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.
Yup. That makes sense. The expected test output has changed, so making it a breaking change makes sense to me 👍🏻
One thought I had.. If this new behaviour were optional, we could release it under an option, which defaults to disabled. If we wanted this to then be the default behaviour, we could release a major version that reflects this.
I'm happy to take care of that if that's how we want to move forward?
@BarryThePenguin Regarding keeping the current behaviour as the default option: I think the new behaviour makes more sense as the default. I propose releasing this as a major, and if issues come in to investigate what users would like: 1) the previous behaviour, or 2) some sort of node filtering where they can choose which nodes to keep, etc, or 3) maybe something else. For this PR: I just noticed that images are also included in the TOC. Is that a good idea? I don’t think people really use images in headings (except maybe the main heading of a readme, but that doesn’t appear in the TOC), so we can either a) not copy images, or b) wait for what people want and potentially allow filtering (2 above) of nodes later. |
Sounds good 👍🏻 |
Closes GH-56.
Closes GH-57.
Closes GH-58.