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

remark-abbr: optionally expand first occurrence inline #311

Conversation

roxspring
Copy link
Contributor

@roxspring roxspring commented Jan 22, 2019

Given the markdown:

This plugin works on MDAST.

More stuff about MDAST.

*[MDAST]: Markdown Abstract Syntax Tree

Then, with options of {expandFirst: true}, the plugin would translate to the following:

Would translate to:

<p>This plugin works on Markdown Abstract Syntax Tree (<abbr title="Markdown Abstract Syntax Tree">MDAST</abbr>).</p>

<p>More stuff about <abbr title="Markdown Abstract Syntax Tree">MDAST</abbr>.</p>

Note that this is not quite as spec'd in #304 since the "(MDAST)" in the initial expansion also gets recursively expanded. This wasn't intentional, and I haven't spotted how to avoid it, but I'm not sure it's awful behaviour either!

Opening a WIP pull request to get feedback on behaviour and implementation. Assuming positive response I'll update with documentation of the new functionality in README.md.

Closes #304

packages/remark-abbr/src/index.js Outdated Show resolved Hide resolved
packages/remark-abbr/src/index.js Outdated Show resolved Hide resolved
packages/remark-abbr/__tests__/index.js Outdated Show resolved Hide resolved
packages/remark-abbr/__tests__/index.js Outdated Show resolved Hide resolved
@roxspring roxspring force-pushed the feature/remark-abbr-optionally-expand-first branch from 0208801 to 0995288 Compare January 22, 2019 22:42
@roxspring
Copy link
Contributor Author

Addressed @houndci-bot complaints.

Not clear whether the @traviscibot issues are introduced by my code changes - advice welcome!

@vhf
Copy link
Contributor

vhf commented Jan 25, 2019

@roxspring Looks good to me, that's definitely a useful feature! 👍

Please go ahead with the README update, I'll fix the failing tests (not your fault, no idea why cyrillic tests suddenly fail).
Edited: fixed the CI, please rebase on master

@roxspring roxspring force-pushed the feature/remark-abbr-optionally-expand-first branch from c9df7d7 to 933b663 Compare January 25, 2019 22:19
@roxspring roxspring changed the title WIP: remark-abbr: optionally expand first occurrence inline remark-abbr: optionally expand first occurrence inline Jan 25, 2019
@vhf
Copy link
Contributor

vhf commented Jan 30, 2019

Thanks, merged via 4915e3b

I'll work on a release next week and will ping you here once released

@vhf vhf closed this Jan 30, 2019
@vhf
Copy link
Contributor

vhf commented Feb 4, 2019

@roxspring Here we go https://www.npmjs.com/package/remark-abbr/v/1.3.0 :)

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.

None yet

3 participants