Open mlthrk opened 3 years ago
marks: false
witn new 3.5.2 release (still RC, will release Feb 9)marks
, you'll still see marks on preview editor, this issue will be fixed 3.5.x.Thanks for looking into this. Not sure if we are talking about the same issue?
Disabling marks completely with marks: false
already works for me with the current 3.5.1 release. I just tried out 3.5.2-rc.1 and didn’t notice much of a difference.
In Writer/Editor.js there are two default options that seem to do what I’m after, though. Setting both disableInputRules
and disablePasteRules
to true
, markdown parsing is disabled but it seems still possible to use the marks formatting of the Writer field. If this was an appropriate way to do this, it’d be great to be able to set these options in a blueprint.
I hope it’s okay for me to add to this – not sure whether this qualifies as an additional issue.
I’m running into the same issue as described above with the default text block in fields:block
. I haven’t found a way to disable marks for this block type or am I missing something?
Thanks!
Since we have text formatting via the tooltip, is the markdown-thing still a feature that is needed in the writer field? Maybe the md parsing can be removed all together?
At least in German the gender-star problem makes it really hard to use the writer field. Thanks for looking into it!
For power users the Markdown syntax can be really useful as it's much faster than using the tooltip. I agree it's not optimal, but I feel like we cannot make everyone happy at the same time.
True, but for speed one can easily use cmd+i
instead of *
to make things italic, which I’d say is equally quick, comfortable and intuitive. While non-power user*innen don’t have such an easy alternative.
It’s fairly easy for power users to adjust to that – while it’s not easy for non-power users to understand why things look weird when they use the gender star and that they have to remember some work around.
I second @moritzebeling I have just worked on a site with a lot of Word-files to copy paste into the writer field and came upon the same annoying behaviour. the gender stars really show an unexpected behaviour, which is hard to understand for editors without the knowledge of markdown. the beauty of the writer field is, that you could now work in there without any markdown skills...
I agree it's not optimal, but I feel like we cannot make everyone happy at the same time.
Maybe you could change the markdown shortcut behavior so the formatting characters need a line break or space.
Look at this, tiptap has markdown shortcuts too and they don't have this issue: https://tiptap.dev/examples/markdown-shortcuts
As mentioned above, these are working workarounds:
marks: false
# or
marks:
- bold
Which unfortunately burns the possibility of having italic text. So it would be great to be able to disable the "smart" markdown behaviour, since I think the confusion it generates is by far bigger than the benefits.
Over the course of this year, I upgraded several Kirby projects to version 3.5 and 3.6, also taking advantage of the writer field and blocks editor. Since every german-language website needs those asterisks now, clients and editors call me up or send bug reports complaining about that asterisk behavior. I now find myself explaining regularly to clients that they have to choose for either italics OR Gender-Sternchen. So after they decide for the Gender-Sternchen, I then have to explain to the graphic designer, that we can't have italic text anymore.
Maybe it’s just me, maybe I just haven’t found a way to implement a fix or educate clients, but: this seemingly small thing has a huge impact.
As mentioned above, I don’t think the advantages of printing italic text between 2 asterisks outweighs the requirement to be able to use the asterisk otherwise.
Maybe it’s just me, maybe I just haven’t found a way to implement a fix or educate clients, but: this seemingly small thing has a huge impact.
What you can try to do until this is fixed (at least until you perform the next upgrade) is to change disableInputRules:!1
and disablePasteRules:!1
in kirby/panel/dist/js/index.js
(and possibly also media/panel/.../js/index.js
) to disableInputRules:!0
and disablePasteRules:!0
. This seems to disable markdown input but keeps marks formatting active.
Sorry for being annoying on this topic, but I have regularly people calling me up requesting to "solve that italic-bug"
Would it make sense to introduce a new field option that completely disables the Markdown syntax for all marks? The keyboard shortcuts would still work, but all text syntax would be ignored and treated as actual text.
Thank you four sour suggestion, I think that could be nice! For German language, you could then simply disable it, while all non German users don’t have to do anything and could benefit from markdown input.
The downside would be, that german users would always also have to override the text block then, but maybe that's what it is... the most important thing right now would be to quickly have a working and downwards compatible status quo solution – just as the one you suggested.
I'd second @lukasbestle's suggestion.
We can be annoyed by the general issue, but that's where Markdown syntax just collided with a variant of gender neutral script. Nothing really to do about it. Although, I'd think that it'll shift away from using the asterisk and rather using a colon, that's already the trend in academia - probably in 2-3 years the more common variant.
Sorry if I'm being stubborn but wouldn't it be better to improve the shortcut behavior like I suggested in my comment above?
Gender stars are in the middle of words — italic formatting is something you do after a space or line break.
@medienbaecker is right. That problem is actually not too hard to fix. The input rule was just outdated. I updated it with the same rule that Tiptap uses and now it works.
✅
Hi, thanks for this! :) Direct input works great! Would it be possible to update pasteRules as well?
@bastianallgeier I tried with the paste rules from tiptap
pasteRules({ type, utils }) {
return [
utils.markPasteRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g, type),
utils.markPasteRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g, type)
];
}
However, if I try to paste Hello*this is really *great*
- it removes the gap after really
, puts great
correctly in italics, but doesn't remove the *
on both sides of great
. And I can't quite understand if there is a difference in our markPasteRule
util function vs. tiptap.
@distantnative our paste rules are indeed not working as the ones in tiptap. They seem to have spent more time on enhancing them. I think we need to take a closer look at their implementation. Right now it does not make sense to update the rules. The result is even worse than before.
Bumping this issue with a different use case which requires the same fix :
Pasting an URL containing at least two _
into a writer field causes the link to be split at the first underscore :
(using the URL https://example.com/url_with_underscores
on the online Kirby demo @ 3.6.6).
My suggestion would be to add a field option to disable markdown parsing.
hey everyone, is there an update or a solution to the asterisk problem? The problem is now appearing in several of our projects, especially when the text block is used...
@jangoedde Which version are you using? I am in 3.8 and to me it seems that the problem is no longer occurring... both typing and pasting
@moritzebeling: Tested on different Versions: 3.5.8, 3.7.5, 3.8.0 ... But you're right, 3.8.0 handles it differently, although it's not 100% working there either. Maybe disabling markdown manually would be helpful.
I'm on Kirby 4.1.2 and text between gender stars gets converted to italics when pasting text.
Describe the bug
When writing in or pasting to a Writer field, text is parsed for the mark characters of the field’s active marks and automatically converted. Thus it is not possible to use these characters for other purposes, e.g. writing the “gender star”. Escaping the mark characters with a backslash seems to be ignored.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
Kirby Version
3.5+