-
Notifications
You must be signed in to change notification settings - Fork 185
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
Tag <code> not triggered on different BBCode code name #871
Comments
Ok debugged it, and found where is problem. SCEditor/src/formats/bbcode.js Line 2488 in 8c50e0b
Is it possible to add a variable, that give us a chance to ignore that check? allowedTagStyles false by default for [code] , but true for others.And replace if (tag !== 'code') to if (allowedTagStyles)
Like
|
Also it looks, like this check not need at all: SCEditor/src/formats/bbcode.js Line 2488 in 8c50e0b
this check does it job and prevents to add SCEditor/src/formats/bbcode.js Line 2379 in 8c50e0b
Sorry if i'm wrong :) |
Unfortunately this is down to the special casing of the Thinking about it, it could be done as an opt-in without a breaking change. Have it default to this behaviour but opt-in to new behaviour although that would increase number of code paths and make things even harder to debug. Not sure if that would be a good idea or not. The easiest solution for now would be to use a different tag, like a span tag for inline codes within the editor. Not ideal though.
It's not that clear but they are both needed. The first stops inline tags and styles being converted and the latter stops block level styles being converted. It really isn't great code and will be changed in the next breaking release but stuck with it for now. |
Thank for the idea, I replaced it via span. |
It looks like another bug with the tag code :)
if we want to set for HTML tag
<code>
two behavior it will not triggerformat:
if it has a BBCode different from[code]
when we switch from WYSIWYG to Source mode.Examle:
Override
[code]
for triggering to a classAdd
[codeinline]
If we do that with different BBcode, for example with [sub] it will work correctly.
Example with code and sub.
https://jsbin.com/yirolubile/1/edit?html,js,output
The text was updated successfully, but these errors were encountered: