Closed petr-hybler closed 4 years ago
Hi @petr-hybler
thanks for your report, i've moved your issue yesterday to the EnlighterJS library repository - it has been fixed asap in v4.1.0
(EnlighterJS v3.2.0
).
if it doesn't work in your case please provide a full code snipped to reproduce the error
Example
the single line comment with quotes issue is fixed .. thx .. but the syntax is still weirdly highlighted :-/
check out the examples
hmm.. it looks like expected...
figure 1: "desc" is a keyword, therefore the other highlighting appears figure 2/3: keywords and "function calls" are mixed...thats not an optimal solution
the general problem with "sql" is that it has normally be split into multiple dialects to cover all use cases (i'm primarily working/testing with mariadb/mysql syntax).
the currently used language rules can be found here: https://github.com/EnlighterJS/EnlighterJS/blob/master/src/lang/sql.js
figure 1: desc is ok .. but how about the NOT NULL ? or highlighted name of the table? same like VARCHAR2 in the next figures ... it's not bold and sometimes highlighted :(
there rule _language_common_rules.fCalls
is actually used to cover something like TYPE(..
- maybe we should remove them
btw. the old language support file: https://github.com/EnlighterJS/EnlighterJS/blob/v2-legacy/Source/Language/Sql.js
without function call regex:
that looks way better imo :) thx ...
btw is there still the option to set a default language as it was previously? or not anymore?
it has been added as "fallback language" option in v4.1 (Enlighter -> Options -> Advanced -> EnlighterJS). but this setting is normally not needed because the shortcodes/markdown/gutenberg/tinymce are setting the language attribute explicitly - whats your intention to use it ?
in the previous versions there were a lot of misunderstandings by the users who didn't know what this setting really does.
all my codes are SQL only :) so it would be nice to have this language "by default" and not to pick it everytime manually (am posting a lot of articles) - that's kinda bother ... not a big deal tho
that's the issue ;) the "default" setting doesn't set any language select boxes even in the legacy versions
the changes have been applied to EnlighterJS v3.2.0
hello the single line comments are not working properly ... when there is a single quote it treats it as a string even tho it's just a comment
example: -- some data and ' this is treated as a string ....