samclarke / SCEditor

A lightweight HTML and BBCode WYSIWYG editor
http://www.sceditor.com/
Other
664 stars 186 forks source link

Text alignment button issue #522

Open BurninLeo opened 8 years ago

BurninLeo commented 8 years ago

Hello,

SCEditor by default may allow left/center/justify/right alignment of text blocks. In version SCEditor v1.4.7 (HTML mode, using Firefox) I came across the following issue regarding these buttons:

When one of the buttons is clicked, the paragraph style gets an align attribute, e.g.,

<p style="align: left;">

When I now click outside the editor, this changes to text-align

<p style="text-align: left;">

Now, I return to the input, and click the center-button, which results in a conflicting CSS style:

<p style="text-align: left; align: center;">

The preview won't change, of course - unless I click outside the editor, which then results in:

<p style="text-align: center;">

Now, when I click back into the input, SCEditor does not recognize the paragraph of being centered, and still shows the "left" button active.

I hope, this description helps to improve the alignment buttons of the magnificent SCEditor. Thank you!

brunoais commented 8 years ago

What can be a bug here is that it adds that align CSS rule which does not exist. Instead, what it should be is text-align.

samclarke commented 7 years ago

This should be easily fixable once the new selection API style methods (#538) are implemented.