question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discuss: XML vs HTML - discoverability and one vs two grammars

See original GitHub issue

opened issue as requested from @joshgoebel in our conversation from

https://github.com/PeterWone/vsc-print/issues/63

Could you please consider this input for eventually upcoming new major-branches:

  1. put the language description file into the right folder (and maybe rename it with an “_” underscore at the beginning to be listed at the beginning) - so that when someone tries to find the correct language description files one has at least a chance to find help without asking someone:

https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md https://github.com/highlightjs/highlight.js/tree/master/src/languages

  1. rename the XML description file into HTML-XML or at least XML-HTML - so that when one is used to the term HTML the proper HTML language description file is showing up

and finally, 3) just as proposal:

to think about the option of having three basic subsets, one that is optimised for xml-html-css-js usage, one that is bundled for some-broad-but-special-programming-languages-used and one that is the full metal jacket release - which should only be used in rare cases of course - it would be so much more convenient … and for sure help a lot of beginners to find their proper way of using highlight.js from startup.

And for those geeks and nerds who really love to look into each file and tweak the shit out of everything there still is the option to bundle the language-files individually, which in turn will for sure find the _SUPPORTED_LANGUAGES.md file in the correct folder.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Dec 17, 2020

Oh I have a long memory for this kind of thing, particularly if it comes up over and over. I will close this for now and we’ll see if it comes up again in the future. People have been building languages using the download website for a long time as well where it’s listed as “HTML, XML” (and having no difficulties finding it).

In our SUPPORTED_LANGUAGES we already have it listed as “HTML, XML”… (so its alphabetical by H)… to me if someone was literally looking thru the file list in an editor and can’t find html the first thing i’d do is a text search for “html” and then it’d quickly be clear that xml.js is the name you wanted.

So perhaps with v11, html_xml.js makes sense… but if it never comes up again, then it never comes up again. 😃

1reaction
joshgoebelcommented, Dec 17, 2020

I think the solution proposed by @ allejo is not duplicating the content, rather than “importing” from one file to another, or did I understood something wrong?

Yes, I understand the distinction, but that effectively duplicates the code the way our build system is currently implemented (grammar modules are stand-alone, all dependencies are resolved at build time).

Yes, or into html_and_xml.js

I suppose you could argue “HTML is more popular” or something… if we list both it seems one has to come first… so we either make it harder to find HTML or XML… I’m not convinced this is a big problem for many people since if you just throw “html” or “xml” at the library itself it “does the right thing” automatically.

It’s only an issue if you go looking for the file and don’t find an “html” file… then hopefully you’d go to the docs and find than XML/HTML are the same thing… so far you’re the only person to bring this to our attention as an issue.


I think it’s possible a simple fix here may be to just alter the official list to include “HTML” in alphabetical order and then refer someone to XML.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XML Vs. HTML: What is Difference Between XML and HTML?
The key difference between XML and HTML is that XML is a framework for specifying markup languages (stores and transfers data). In contrast, ......
Read more >
XML vs HTML: Differences and similarities - VentureBeat
While HTML is a simple predefined language, XML is a standard language used to define other languages. The importance of learning both HTML...
Read more >
XML and Accessibility - W3C
Compared to HTML or SMIL, XML is one level up, and in addition to the usual ... XML is a meta-syntax, used to...
Read more >
XML vs. HTML: What are the Differences? - Geekflare
HTML is used to display data and describe the structure of a web page, whereas XML is used to store and transmit the...
Read more >
XML vs HTML: What's the Difference? - KeyCDN Support
Wondering how XML and HTML differ? We make the ultimate comparison and let the languages run against each other.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found