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

Add support for configurable opening, closing quotes #8

Merged
merged 6 commits into from
Jun 24, 2022

Conversation

stefanprobst
Copy link
Contributor

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

languages other than english might have other conventions for which characters to display for opening and closing quotes. this pr adds two options to make opening and closing quotes configurable.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jun 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2022

Codecov Report

Merging #8 (fe0b21e) into main (aae96ee) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main        #8   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          384       411   +27     
=========================================
+ Hits           384       411   +27     
Impacted Files Coverage Δ
index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aae96ee...fe0b21e. Read the comment docs.

Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

This also needs some docs!

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like your double and single, as this is about which quote was in the original code: " or ', and replacing those.

if (node.value === '`') {
node.value = '‘'
} else if (node.value === "'") {
node.value = '’'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be affected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, good point, yes should probably be affected as well i think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, that isn’t about " (and ').
That would perhaps need “primary, secondary” options instead?
Easier to leave it as is for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, ok should i revert 59d7be4 then?

readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@wooorm wooorm changed the title Make opening and closing quotes configurable Add support for configurable opening, closing quotes Jun 24, 2022
@wooorm wooorm merged commit 9032293 into retextjs:main Jun 24, 2022
@github-actions

This comment has been minimized.

@wooorm wooorm added 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change 💪 phase/solved Post is done labels Jun 24, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Jun 24, 2022
@wooorm
Copy link
Member

wooorm commented Jun 24, 2022

I’ll try and get a release done this weekend. Hoping to rework the docs and modernize things as well.

@stefanprobst stefanprobst deleted the feat/quotes-options branch June 24, 2022 09:45
@wooorm
Copy link
Member

wooorm commented Jun 25, 2022

Released in 5.2.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

3 participants