Skip to content
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

Problems with custom formats #190

Closed
rsvitak opened this issue Jan 20, 2020 · 3 comments
Closed

Problems with custom formats #190

rsvitak opened this issue Jan 20, 2020 · 3 comments
Labels
Milestone

Comments

@rsvitak
Copy link

rsvitak commented Jan 20, 2020

I am using this custom configuration of formats:
formats: [ { tag: 'p', // Tag name name: 'NORMAL', // default: tag name command: 'replace', // default: "replace" 'class': '__se__format__NORMAL', // Class names must always begin with "__se__format__" }, { tag: 'div', // Tag name name: 'CODE', // default: tag name command: 'replace', // default: "replace" 'class': '__se__format__CODE', // Class names must always begin with "__se__format__" } ],

When run suneditor with this configuration I have 2 issues (maybe rather requirements?):

  1. in main menu (balloon style) the name of the current format is not NORMAL or CODE, but just P or DIV. The NORMAL and CODE is only displayed in the submenu. This is quite confusing, can it be configured somehow?

  2. Switching between formats works well, P element is switched to DIV and viceversa. But the value of class attribute is rather strange: First adjusting to CODE is ok. But after changing the format from CODE to NORMAL it becomes: "__se__format__NORMAL __se__format__CODE", after changing back to NORMAL it becomes: "__se__format__CODE __se__format__NORMAL".

But generally it works well. I wish the default P and PRE formats could work the same in SunEditor. The only reason is that I would like to have as simple HTML documents as possible consisting of just simple P, PRE, BR (etc.) elements if possible. The additional HTML attributes are not needed.

@rsvitak rsvitak changed the title Switching custom formats doesn't replace CSS class names. Problems with custom formats Jan 20, 2020
@JiHong88
Copy link
Owner

Hi, @rsvitak

  1. It will be modified to behave like the "CODE" format of the froala editor.
  2. It will fix the bug where the "__se__format__" class name remains.
  3. It will modify it so that the set name is displayed.

I'll notify you when the edit is complete and the version is updated.
Thank you.

@rsvitak
Copy link
Author

rsvitak commented Jan 21, 2020

Thank you very much sir!

JiHong88 added a commit that referenced this issue Feb 11, 2020
JiHong88 added a commit that referenced this issue Feb 12, 2020
add: util-isFreeFormatElement, getFreeFormatElement #190
@JiHong88 JiHong88 added this to the 2.26.0 milestone Mar 4, 2020
@JiHong88 JiHong88 closed this as completed Mar 4, 2020
@JiHong88
Copy link
Owner

The 2.26.0 version has been updated.
If there is an issue, please register as a new issue.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants