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

getSemanticHTML outputs HTML with a ql- class #4156

Open
Kostia-K opened this issue May 1, 2024 · 5 comments
Open

getSemanticHTML outputs HTML with a ql- class #4156

Kostia-K opened this issue May 1, 2024 · 5 comments

Comments

@Kostia-K
Copy link

Kostia-K commented May 1, 2024

When using indentation tools, getSemanticHTML produces HTML where indented text has class="ql-indent-1" which requires quill CSS to render correctly. This means, indentation will not be preserved when you export HTML somewhere else.

Steps for Reproduction

  1. Playground link
  2. Enter any text
  3. Press button to increase indent

Expected behavior:

Semantic HTML should contain style that allows rendering without the Quill stylesheet (e.g. style="padding-left: 3em")

Actual behavior:

Semantic HTML contains ql-indent-1 class which is meaningless outside the Quill editor.

Platforms:

Include browser, operating system and respective versions
MacOS Sonoma 14.4.1, Firefox 125, Safari 17, Chrome 124

Version:

2.0.0

@luin
Copy link
Member

luin commented May 1, 2024

I'm seeing the correct nested <ul> structure: https://share.slab.com/3LzpmqCc. Did I miss anything?

@Kostia-K
Copy link
Author

Kostia-K commented May 1, 2024

How did you get list items with the bullet characters?

This is what I'm seeing

Screenshot from 2024-04-30 20-32-22

@luin
Copy link
Member

luin commented May 1, 2024

Okay I got you. I thought it was about lists. This is a bit tricky as there's no standard way to express the indentation of a block in HTML so one would argue that padding-left: 3em is harder to parse than ql-indent-2. At least Quill doesn't recognize padding-left when you paste HTML into the editor

@Kostia-K
Copy link
Author

Kostia-K commented May 1, 2024

For what it's worth, Outlook and Gmail use multiples of margin-left: 40px inline for indentation. Regardless of whether Quill intends to support emails, this could be a valid approach to this problem.

@amyasmith
Copy link

This also seems to be the case by default with align. It will output the ql-align- class unless the align style attributor is imported and then registered over the align format. This isn't mentioned in the docs anywhere from what I can see.

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

No branches or pull requests

3 participants