add hack-a-round for language specified markdown code blocks
When language is specified in a markdown code block such as:
````
```c
printf("Hello, world!\n");
```
````
is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.
A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment. For example:
````
```<!---c-->
printf("Hello, world!\n");
```
````
This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better "_hack-a-round_" to the "markdown code language
specifier" problem is found.
The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:
```
<pre class="<!---c-->"><code> .. </code></pre>
```
We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.
For now, this hack-a-round will have to do.
This commit is contained in:
1 parent
3919df50fb
commit
b66c79254a
700 files changed
+7052
-7056
No files matched your search
+5
-5
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hou syntax-file file-to-process
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ The following regular expression operators are supported:
|
||||
For example, one can use the following expression to match a certain declaration
|
||||
statement in [hou.c](hou.c):
|
||||
|
||||
```re
|
||||
```<!---re-->
|
||||
"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;
|
||||
```
|
||||
|
||||
@@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point,
|
||||
hang for the competing Perl engine while matching itself. Try to compare these
|
||||
two engines:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt
|
||||
```
|
||||
|
||||
+5
-5
@@ -124,9 +124,9 @@
|
||||
|
||||
<h2 id="judges-comments">Judges’ comments:</h2>
|
||||
<h3 id="to-build">To build:</h3>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> hou</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make hou</code></pre>
|
||||
<h3 id="to-run">To run:</h3>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> syntax-file file-to-process</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hou syntax-file file-to-process</code></pre>
|
||||
<h3 id="try-unix">Try (Unix):</h3>
|
||||
<p>The results are best viewed in a 80x25 console with ANSI colors.</p>
|
||||
<pre><code> less hou.c
|
||||
@@ -170,12 +170,12 @@ in the regular expression by escaping it with [] or ““.</p>
|
||||
<p>The following regular expression operators are supported:</p>
|
||||
<pre><code> () [] * + ? | ""</code></pre>
|
||||
<p>For example, one can use the following expression to match a certain declaration statement in hou.c:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="st">"char"</span><span class="op">[</span> <span class="op">*]*[</span>a<span class="op">-</span>zA<span class="op">-</span>Z_<span class="op">][</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span>zA<span class="op">-</span>Z_<span class="op">]*[</span> <span class="op">]*((=[</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span>zA<span class="op">-</span>Z_ <span class="op">]+)|(</span>\<span class="op">[[</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span><span class="at">zA</span><span class="op">-</span><span class="at">Z_ </span><span class="op">]*</span><span class="at">\</span><span class="op">]))?[</span><span class="at"> </span><span class="op">]*(,[</span><span class="at"> </span><span class="op">*]*[</span><span class="at">a</span><span class="op">-</span><span class="at">zA</span><span class="op">-</span><span class="at">Z_</span><span class="op">][</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span><span class="at">zA</span><span class="op">-</span><span class="at">Z_</span><span class="op">]*[</span><span class="at"> </span><span class="op">]*((=[</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span><span class="at">zA</span><span class="op">-</span><span class="at">Z_ </span><span class="op">]+)|(</span><span class="at">\</span><span class="op">[[</span><span class="dv">0</span><span class="op">-</span><span class="dv">9</span><span class="er">a</span><span class="op">-</span><span class="at">zA</span><span class="op">-</span><span class="at">Z_ </span><span class="op">]*</span><span class="at">\</span><span class="op">]))?[</span><span class="at"> </span><span class="op">]*)*;</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;</code></pre>
|
||||
<p>The regex engine is also algorithmically efficient. To illustrate the point,
|
||||
ansi.txt contains a pathological expression [2] that guarantees a hang for the
|
||||
competing Perl engine while matching itself. Try to compare these two engines:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> ansi.txt ansi.txt</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">perl</span> patho.pl <span class="op"><</span> ansi.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt</code></pre>
|
||||
<p>Finally, there are a few limitations…</p>
|
||||
<ul>
|
||||
<li>The only escape sequence supported is and it doesn’t work in [].</li>
|
||||
|
||||
+4
-4
@@ -2,13 +2,13 @@
|
||||
|
||||
### To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make hou
|
||||
```
|
||||
|
||||
### To run:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hou syntax-file file-to-process
|
||||
```
|
||||
|
||||
@@ -81,7 +81,7 @@ The following regular expression operators are supported:
|
||||
|
||||
For example, one can use the following expression to match a certain declaration statement in hou.c:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;
|
||||
```
|
||||
|
||||
@@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point,
|
||||
ansi.txt contains a pathological expression [2] that guarantees a hang for the
|
||||
competing Perl engine while matching itself. Try to compare these two engines:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt
|
||||
```
|
||||
|
||||
+6
-6
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#CN">CN</a> - <em>People’s Republic of C
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> syntax-file file-to-process</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hou syntax-file file-to-process</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>View the <code>remarks.htm</code> file in your web browser.</p>
|
||||
<p>The result is best viewed in a 80x25 console with ANSI colors.</p>
|
||||
<h2 id="try-windows">Try (Windows):</h2>
|
||||
@@ -183,13 +183,13 @@ in the regular expression by escaping it with <code>[]</code> or <code>""</code>
|
||||
<pre><code> () [] * + ? | ""</code></pre>
|
||||
<p>For example, one can use the following expression to match a certain declaration
|
||||
statement in <a href="hou.c">hou.c</a>:</p>
|
||||
<pre class="re"><code> "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;</code></pre>
|
||||
<pre class="<!---re-->"><code> "char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;</code></pre>
|
||||
<p>The regex engine is also algorithmically efficient. To illustrate the point,
|
||||
<a href="ansi.txt">ansi.txt</a> contains a pathological expression <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a> that guarantees a
|
||||
hang for the competing Perl engine while matching itself. Try to compare these
|
||||
two engines:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> ansi.txt ansi.txt</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">perl</span> patho.pl <span class="op"><</span> ansi.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt</code></pre>
|
||||
<h3 id="limitations">Limitations</h3>
|
||||
<p>Finally, there are a few limitations…</p>
|
||||
<ul>
|
||||
|
||||
Reference in new issue
Block a user