-
Notifications
You must be signed in to change notification settings - Fork 81
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
FR: Curly quotes from straight quotes #399
Comments
This may help in implementing this feature: https://github.com/othree/smartypants.js |
As far as I am aware, this is not a hard feature to add, but this is not a high priority on my list of things to work on right now. I am open to PRs around this, but the most I can say about this right now is that it is in the project backlog and will be addressed as those tickets get worked through. Thanks for your patience! |
Just looking at some issues with Smart Typography, there may be problems with converting to curly quotes with other parsing plugins, in particular Templator and the sidenotes CSS hack. This doesn't mean it can't be done, but I would see what @mgmeyers comes up with first. It might be nice to have, but at the risk of losing Templator-like plugins, I'll stick with straight quotes. ;-) |
As noted by @slappycat2, it will likely cause issues with YAML and plugins, so it is not recommended that the curly single or double quotes be used. Even so, I think that the custom regex feature that has been suggested (#455 ) would allow this change. |
It should be possible to not convert within YAML or code blocks, right? Wouldn't that avoid the problem? |
That would potentially avoid the problem, but the custom regex would not know the difference. Thus you would have to use custom ignore (#334) to get finished in the next couple of releases to go ahead and do the change. |
So while it is possible, this would likely not be directly supported natively in the linter as a rule specifically for this. It would likely be made up of custom ignore and custom replace being used in conjunction with one another. |
Note that the issues with plugins like Templater would likely still exist as well as incompatibility with other plugins as well. |
I mean—I'm not familiar with the Obsidian API, but does it report when something is supposed to be rendered in monospaced font? |
I don't think I understand the question. What do you mean report whether something is in monospaced font? It uses the same font for all present markdown unless css styling specifies otherwise. |
When I am making this change, I am not adding any special concern for Templator. I may need to consider doing so to prevent issues with that plugin. I will reevaluate once I get the core of the logic in place. I am planning on ignoring code blocks, math block, inline code, inline math, YAML, and html. I may need to add a regex match for templater blocks as well to make sure I do not update them either as that is code. But the recent feature to turn off the Linter for specific portions of code (#725 ) should allow for ignoring Templater blocks manually. |
This rule should be added in the next release. If it has any issues please let us know. Note that this rule should ignore Templater blocks. |
Is Your Feature Request Related to a Problem? Please Describe.
I often run into straight quotes in my documents, either because my system put them in as I typed, or because I pasted some text in that contained them.
Describe the Solution You'd Like
I would like a Rule that changed straight single and double straight quotes to curly ones.
Describe Alternatives You've Considered
The Smart Typography plugin does this, but only as you type, not afterwards.
The text was updated successfully, but these errors were encountered: