Maarrk
(Marek Ł.)
July 17, 2024, 9:26am
1
When I type on the computer, I get “fancy” quotation marks, i.e. U+201C Left Double Quotation Mark
and U+201D Right Double Quotation Mark
, but when I type on mobile, or inside a code block, or in Ctrl+F
search I get the simple '
and "
from ASCII.
Is there a way to disable some code from cm_plugins
? I’ve identified the file that does the functionality I want to avoid, but it’s too minor to run a fork just for that.
import { KeyBinding } from "@codemirror/view";
import { syntaxTree } from "@codemirror/language";
import { EditorSelection } from "@codemirror/state";
const straightQuoteContexts = [
"CommentBlock",
"CodeBlock",
"FencedCode",
"InlineCode",
"FrontMatterCode",
"Attribute",
"CommandLink",
"TemplateDirective",
];
// TODO: Add support for selection (put quotes around or create blockquote block?)
function keyBindingForQuote(
originalQuote: string,
left: string,
right: string,
This file has been truncated. show original
zef
(Zef Hemel)
July 17, 2024, 10:25am
2
I think it’d be perfectly fine to make this a setting in SETTINGS to be honest.
Maarrk
(Marek Ł.)
July 17, 2024, 10:36am
3
Don’t want to distract you from bigger and more interesting features, expect a PR
1 Like
zef
(Zef Hemel)
July 17, 2024, 10:40am
4
I hoped you would say that
Maarrk
(Marek Ł.)
July 19, 2024, 1:17am
5
Submitted, linking that the detailed implementation discussion will probably be there:
silverbulletmd:main
← Maarrk:pr-smart-quotes-setting
opened 01:16AM - 19 Jul 24 UTC
As discussed in [Unwanted Unicode quotation marks - Troubleshooting - SilverBull… et Community](https://community.silverbullet.md/t/unwanted-unicode-quotation-marks/669)
**Needs a refresh for the setting to take effect.** I noticed that syscalls don't work in the `web` folder, so I reworked the array into function like `createCommandKeyBindings`.
I don't know nice ways to save the reference to client and check the current setting when the shortcut is triggered ¿I would use `var` to save reference to client inside the function? I don't know...
If we accept that this needs a reload, I could make it a bit simpler.
3 Likes