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

[repo] Add markdown lint rule to convert directional quotes to their non-directional variants #104

Merged
merged 2 commits into from May 11, 2022

Conversation

andrewnicols
Copy link
Member

@andrewnicols andrewnicols commented May 3, 2022

Related to #102

This should prevent additional use of the following characters:

These will be converted to either " or ' as appropriate.

@andrewnicols andrewnicols marked this pull request as draft May 3, 2022 14:16
@andrewnicols
Copy link
Member Author

This commit adds a new, custom, markdownlint rule. It is not applied automatically. It is not possible to configure it to run from config from my understanding (deliberate design decision).

I think that this is ready but I'll check tomorrow.

@andrewnicols andrewnicols force-pushed the noApostrophe branch 2 times, most recently from 0bfe221 to 5fcdec0 Compare May 4, 2022 04:17
@andrewnicols andrewnicols marked this pull request as ready for review May 4, 2022 04:25
@andrewnicols
Copy link
Member Author

Okay, this should now be ready.

I've rebased it on #106, which adds vscode workspace recommendations and configuration. This allows us to add the markdownlint custom rules into the vscode configuration. There is no way to do this in a nice, easy, way otherwise.

@andrewnicols
Copy link
Member Author

Hi @lucaboesch,

This change should prevent further issues with the use of true apostrophes in markdown files and will automatically fix them.

@andrewnicols andrewnicols marked this pull request as draft May 4, 2022 04:46
@lucaboesch
Copy link
Collaborator

That is great news, @andrewnicols!

But it should probably look out for ‘ as well (like in https://github.com/moodle/devdocs/blame/main/general/development/process/testing/qa.md#L193).
Should we additionally worry about “ and ”, too (in the same line)?

Best,
Luca

@andrewnicols
Copy link
Member Author

Hi @lucaboesch ,

It specifically is looking for - thats the point and it does pick up the issue in qa.md.

I'm thinking of extending it to fix to " but I need to track down a probem with vscode first.

@lucaboesch
Copy link
Collaborator

Yeah, @andrewnicols but you see, ‘ is just like ’ typographically.
You probably notice that it's basically the same, only one has the thicker end up, and the other one has the thicker end down.
I think that one should be looked for, too.
But, of course, vscode problem first.

@andrewnicols andrewnicols changed the title [repo] Add markdown lint rule to convert apostrophe to single quote [repo] Add markdown lint rule to convert directional quotes to their non-directional variants May 4, 2022
@andrewnicols
Copy link
Member Author

Right, thanks Luca, I worked that out a short while ago. IT doesn't help that github eats half the characers unless you put them in backticks. Please ensure that you put these in the relevant backticks in future.

@andrewnicols andrewnicols marked this pull request as ready for review May 4, 2022 08:18
@andrewnicols
Copy link
Member Author

Okay, this is finally ready for review now that I've worked out all of the kinks.

I was looking at moving to markdownlint-cli2, but that's just a different level of pain.

@andrewnicols andrewnicols requested a review from sarjona May 4, 2022 08:20
@lucaboesch
Copy link
Collaborator

Brilliant, @andrewnicols !

Left and Right single quotes (`‘` and `’`) are converted to a single
quote or apostrophe (`'`).

Left and Right double quotes (`“` and `”`) are converted to a double
quote (`"`).
@andrewnicols
Copy link
Member Author

This has been waiting for review for a week and I really need the infrastructure changes that this provides for some related chagnes. Self-merging when tests finish.

@andrewnicols andrewnicols merged commit 276f5b0 into moodle:main May 11, 2022
@andrewnicols andrewnicols deleted the noApostrophe branch May 11, 2022 10:04
@sarjona
Copy link
Member

sarjona commented May 11, 2022

Hi @andrewnicols!
My apologies for the late review (I've been busy these days). The patch looks great and it's working as expected.
I've found a few more occurrences with this characters, but I'll create a separate issue for them :-)

sarjona added a commit to sarjona/devdocs that referenced this pull request May 11, 2022
In moodle#104 a markdown lint rule
has been added to convert directional quotes to their non-directional
variants.
This patch manually replaces the missing directional quotes.
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