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

WYSIWYG editor error - Text aligning in <th> element uses align="" attribute #13

Open
MarkoSulamagi opened this issue Sep 10, 2018 · 0 comments

Comments

@MarkoSulamagi
Copy link

Expected Behavior

When aligning text wrapped in <th></th> element then the text should be aligned with inline CSS.

Current Behavior

Currently there are 2 problems.

  1. If I align <th> element itself then the html element align="" is used. This is overwritten by global CSS (if it's applied) and align="" has no effect.
  2. If the text inside <th> is aligned then the <th> element itself is wrapped in <div style="text-align: left"><th></th></div>. But this breaks html semantics as <th> should never be wrapped in div. And the align doesn't work.

Steps to Reproduce (for bugs)

Have a table, add <th></th> tags in WYSIWG editor and try to align the text in it with wysiwyg tools.

Extra infromation

If I understand correctly then @mikkpr has debugged this before

Transcript from slack

Marko Sulamägi [10:20 AM]
Hei
Voogi WYSIWYG editor alignib teksti tabeli sees align="" attribuudiga. Kuna see pole HTML5's supported enam, siis kui cell'il on eelnevalt `text-align` CSSga küljes, siis browserid ignoreerivad align='' parameetrit.
Kas sellele on mingi alternatiiv ka olemas äkki? :slightly_smiling_face:
Mikk Pristavka [11:25 AM]
hmm, tõepoolest.
kui iga celli sisu eraldi valida ja alignida, siis ta paneb sellele text-align stiili ja celli `align` atribuuti ei seata, mis võib olla võimalik workaround, aga panen ka kirja, et me selle cell aligni asja ära lahendaks millalgi
Marko Sulamägi [11:28 AM]
Kui celli sisu eraldi valida ja alignida, siis ta wrapib <th></th> eraldi <div style="text-alg..."></div> sisse. Mis pole päris korrektne
Ja ka ei toimi
Mikk Pristavka [11:36 AM]
hm, too näide mõnest celli sisust, mis nii käitub. mul oma testsaidil paneb tavatekstile ise <span style=...> ümber ja kui on juba kuidagi formaaditud tekst, paneb sellele otse style atribuudi külge
aha, <th> puhul tõesti käitub nii
selle lisasid source vaates ise?
peab siis tabelitööriista whitelistid üle vaatama ja thead/th elementidega ka arvestama
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant