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

Separate HTML and XML languages in code blocks? #5794

Closed
Reinmar opened this issue Nov 25, 2019 · 5 comments · Fixed by ckeditor/ckeditor5-code-block#10
Closed

Separate HTML and XML languages in code blocks? #5794

Reinmar opened this issue Nov 25, 2019 · 5 comments · Fixed by ckeditor/ckeditor5-code-block#10
Labels
package:code-block type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Reinmar
Copy link
Member

Reinmar commented Nov 25, 2019

They are treated right now as the same thing:

image

But HTML is not a valid XML and perhaps may break code highlighters. Plus it is not correct to mark HTML as XML semantically.

I'd have two separate positions.


If you'd like to see this feature implemented, add a 👍 reaction to this post.

@Reinmar Reinmar added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 25, 2019
@Reinmar Reinmar added this to the iteration 28 milestone Nov 25, 2019
@Reinmar
Copy link
Member Author

Reinmar commented Nov 25, 2019

cc @oleq @jodator

@Reinmar
Copy link
Member Author

Reinmar commented Jan 17, 2020

Let's answer here a question of how do other highlighters treat HTML and XML. As one thing or separate things.

@Comandeer
Copy link
Member

The rules of these two languages are just too different to be treated in the same way.

Valid HTML, invalid XML:

  1. <!DOCTYPE html>
    	<title>Test</title>
    </head>
    	<p>Test</p>
  2. <ImG SrC=https://www.comandeer.pl/images/custom/comandeer.jpg>
  3. <p>Paragraph<h1>Heading</h1>

Valid XML, invalid HTML:

  1. <script src="https://cdn.ckeditor.com/4.13.1/standard/ckeditor.js" />
  2. <br></br>
  3. <p><div></div></p>

@oleq
Copy link
Member

oleq commented Jan 20, 2020

highlight.js uses the same highlighter for HTML and XML. Prism, on the other hand, separates them.

FYI, I'm OK with separating them. But I don't think this is a big enough issue since nobody voted for this issue so far. Also, please keep in mind, we're talking about the default configuration here only. Developers who don't like the HTML/XML coupling can create a config on their own with whatever they find necessary.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 20, 2020

OK, let's keep the current defaults and wait for feedback.

@Reinmar Reinmar modified the milestones: iteration 29, backlog Jan 20, 2020
@Reinmar Reinmar modified the milestones: backlog, iteration 31 Mar 27, 2020
Reinmar added a commit to ckeditor/ckeditor5-code-block that referenced this issue Mar 27, 2020
Other: XML and HTML will not be treated as the same language. Closes ckeditor/ckeditor5#5794.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:code-block type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants