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

Added firstline regex for HTML, CSS, SQL and JSON #146

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hrc/hrc/proto.hrc
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,27 @@
<location link="inet/html.hrc" />
<filename>/\.[^ptr]??html?$/i</filename>
<firstline>/^\s*&lt;((!DOCTYPE\s+)?HTML|!\-\-)/i</firstline>
<firstline>/^\s*&lt;(html|head|title|body)\b/i</firstline>
<firstline>/^\s*&lt;(div|span|a|script|style|table|form)\b/i</firstline>
<parameters>
<param name="conditional-comments" value="true" description="IE conditional comments" />
<param name="html-pairs" value="true" description="Highlighting some known HTML Pair tags. Please, use &lt; /&gt; syntax for singles like p, td, tr etc.." />
<!-- firstline -->
<param name='firstlines' value='2' description="lines for 'firstline'" />
<param name='firstlinebytes' value='2000' description="bytes for 'firstline'" />
</parameters>
</prototype>

<prototype name="css" group="inet" description="css">
<location link="inet/css.hrc" />
<filename>/\.css$/i</filename>
<firstline>/^\s*[\.\#\w-]+\s*\{/i</firstline>
<parameters>
<param name="html-css" value="true" description="Default use css for HTML" />
<param name="svg-css" value="false" description="Default use css for SVG" />
<!-- firstline -->
<param name='firstlines' value='2' description="lines for 'firstline'" />
<param name='firstlinebytes' value='2000' description="bytes for 'firstline'" />
</parameters>
</prototype>
<prototype name="html-css" group="inet" description="css for html">
Expand Down Expand Up @@ -570,8 +579,13 @@
<prototype name="sql" group="database" description="SQL, PL/SQL">
<location link="db/sql.hrc" />
<filename>/\.sql$/i</filename>
<firstline>/^\s*(SELECT|INSERT INTO|UPDATE|DELETE FROM)\s+.*?\s+(FROM|INTO|SET|WHERE)\b/i</firstline>
<firstline>/^\s*--.*$|^\s*\/\*.*\*\/$/i</firstline>
<parameters>
<param name="backslash_escapes" value="true" description="Treat \' in character literals as an escaped '" />
<!-- firstline -->
<param name='firstlines' value='10' description="lines for 'firstline'" />
<param name='firstlinebytes' value='2000' description="bytes for 'firstline'" />
</parameters>
</prototype>
<prototype name="mysql" group="database" description="MySQL">
Expand Down Expand Up @@ -1006,6 +1020,7 @@
<prototype name="json" group="rare" description="JSON">
<location link="rare/json.hrc" />
<filename weight='3'>/\.json$/i</filename>
<firstline weight="3">/^\s*\{\s*"\w+":/i</firstline>
</prototype>
<prototype name="yaml" group="rare" description="YAML">
<location link="rare/yaml.hrc" />
Expand Down