-
Notifications
You must be signed in to change notification settings - Fork 128
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
Finding issues and solution related to HTML-wrapping function #518
Comments
Hi @bevacqua !! .If you could also suggest the possible solution to above problems that will be highly thankful!! |
Since Woofmark is no longer maintained, our best bet is to fork it and patch issues. |
@VladimirMikulic that not the problem |
I think it might be worth mentioning that wrapping functions makes changes to the selected text like in #457 (comment) and #487 (comment) and these changes are not always desirable. |
Hi all. Here at https://bevacqua.github.io/woofmark/ the HTML mode works fine for both bold formatting and exiting out of code block, the issues only occur in wysiwyg mode. I think this should possibly be because some extra tags like the To confirm this, try typing some formatted text in the HTML mode, and seeing the markup and then typing exactly the same thing again in WYSIWYG mode, switch to HTML and see the markup it produced. They don't come out the same. I think we need to identify when these tags are inserted and get the wrapping function to also filter out the extra tags and characters. |
HTML mode in woofmark uses wrapping function which is defined here https://github.com/bevacqua/woofmark/blob/master/src/html/wrapping.js . This function has various issues. It's used by Bold, Italic, Code and blockquote
https://github.com/bevacqua/woofmark/blob/master/src/html/wrapping.js#L5 . variable close defined here works well for modules having one tag eg
<strong>
but doesn't work for modules like code which have more than one tag Eg code Module<pre><code>
as closing tag should be</code></pre>
and not</pre></code>
. A possible solution could be to write a separate wrapping function for the code module.https://github.com/bevacqua/woofmark/blob/master/src/html/wrapping.js#L14 the leading variable defined here and rleading variable defined here https://github.com/bevacqua/woofmark/blob/master/src/html/wrapping.js#L6.
Now, this has $ in regex, which matches only the last of the string. But when the chunk is not selected it causes some abrupt behavior.
Eg in Code
Bold module also behaves in a similar way;
What should be the possible solution for this?
Eg like in markdown mode, for Bold in markdown we do it through https://github.com/bevacqua/woofmark/blob/master/src/markdown/boldOrItalic.js#L23-L26
@Shreyaa-s Any more bugs related to this to wrapping function?
The text was updated successfully, but these errors were encountered: