**bold**? becomes <strong>bold</strong>?
Describe the bug
While in WYSIWYG edit type and changing text to bold followed by question-mark will make it change to strong-tag instead. These changes will also follow if you switch from WYSIWYG to Markdown.
Using: @toast-ui/editor 3.2.1
To Reproduce
Steps to reproduce the behavior:
**Test-text**? becomes <strong>Test-text</strong>?
**Test-text** ? becomes **Test-text** ?
**Test-text?** becomes **Test-text?**
Expected behavior
**Test-text**? becomes **Test-text**?
Screenshots
Desktop (please complete the following information):
- OS: [osx]
- Browser [chrome]
- Version [Version 106.0.5249.119 (Official Build) (arm64)]
It seems to have something to do with one of the tasks we did. I'll check it out later.
I have the same behavior with the last version of vue-editor.
I have the same behaviour with the pure js version. Is there any branch / fix available?
This feature makes many problem. Due to the structure of the current editor, it is difficult to deal with it. so we'll rollback commit over this issue soon. @jajugoguma takes this issue.
I saw above that you guys are already working on this, but is there any workaround or mitigation available to avoid this error?
- thanks for this great piece of software
Also interested in an solution :)
In the meantime I'm using a mitigation in my project. It is not perfect, but works for me
in global scope ( https://github.com/freegroup/electra/blob/main/common/public/js/polyfill.js#L8-L20 )
let tokenMap = {
"<strong>": "**",
"</strong>": "**",
"<em>": "*",
"</em>": "*"
}
String.prototype.tuiMarkdownFix = function(){
var re = new RegExp(Object.keys(tokenMap).join("|"),"g");
return this.replace(re, function(matched){
return tokenMap[matched];
});
}
when fetching the markdown from the editor (https://github.com/freegroup/electra/blob/main/author/public/js/editor/wysiwyg/editor.js#L45 )
let markdown = this.tuiEditor.getMarkdown().tuiMarkdownFix()
Thatβs cool @freegroup! I thought about doing something similar. This does not consider markdown code blocks and inline code, right?
codeblocks, which contains <strong> or one of the other tags, gets converted...unfortunately. But for my usecase, it is pretty fine.
We forgot to create a release, see related issues (v3.2.2)
good news! Thanks. is this available via npm as well?
It was actually published to npm last week. we missed writing the release notes.
3.2.2 seems to fix this. At least in my case.
@jwlee1108 so was it fixed or not? Perhaps we could close this issue if it was?