Open
Description
Describe the bug
Indentation rules are applied inside <pre>...</pre>
blocks
Which terms did you search for in the documentation and issue tracker?
"pre"
Environment
Python 3.8
curlylint==0.12.0
Steps to reproduce
If I run curlylint --rule 'indent: 2'
on a snippet like
<pre class="highlight"><code>SELECT
pid,
(CURRENT_TIMESTAMP - query_start) as query_time,
datname,
usename,
query
FROM pg_stat_activity
ORDER BY query_time DESC;
</code></pre>
curlylint wants me to change it to
<pre class="highlight">
<code>
SELECT
pid,
(CURRENT_TIMESTAMP - query_start) as query_time,
datname,
usename,
query
FROM pg_stat_activity
ORDER BY query_time DESC;
</code>
</pre>
to resolve the indent errors. Doing this changes the meaning/display of this snippet from
SELECT
pid,
(CURRENT_TIMESTAMP - query_start) as query_time,
datname,
usename,
query
FROM pg_stat_activity
ORDER BY query_time DESC;
to
SELECT
pid,
(CURRENT_TIMESTAMP - query_start) as query_time,
datname,
usename,
query
FROM pg_stat_activity
ORDER BY query_time DESC;
Expected behavior
Don't enforce indentation rules inside <pre>...</pre>
blocks
Actual behavior
0:5 '<code>SELECT\n p…' should be on the next line indent
0:11 Bad text indentation, expected 4, got 2 indent
0:11 Bad text indentation, expected 4, got 0 indent
8:0 Bad indentation, expected 2, got 0 indent
8:7 '</pre>' should be on the next line indent
Activity