alexkay / hilite.me

hilite.me converts your code snippets into pretty-printed HTML format, easily embeddable into blog posts, emails and websites.
http://hilite.me
GNU Affero General Public License v3.0
418 stars 117 forks source link

Nonstandard apostrophe character #20

Open jro1234 opened 1 year ago

jro1234 commented 1 year ago

I want to copy-paste the HTML output from http://hilite.me/. I put this in for example so I can make it nice and explain how to solve issues, I like your tool overall and plan to use it a bunch.

fexxxxor
Fetching data: 02:38:55 
Traceback (most recent call last): 
    File "/hoxxxtroller.py", line 55, in <module> 
        update_xxxe(**runtime_opts) 
    File "/hxxxne.py", line 61, in uxxxine 
        results.append(module.runme( 
    File "/hxxxxr.py", line 55, in runme 
        dfxxxxor = cxxxxe.fetch_data( 
    File "/hoxxxxx.py", line 397, in fetch_data 
        query_result_item = query_result['items’] 
KeyError: 'items’ 
>>>

I get this back:

<!-- HTML generated using hilite.me --><div style="background: #000000; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><table><tr><td><pre style="margin: 0; line-height: 125%"> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13</pre></td><td><pre style="margin: 0; line-height: 125%"><span style="color: #cccccc">feed</span><span style="color: #3399cc">/</span><span style="color: #cccccc">investigator</span>
<span style="color: #cccccc">Fetching</span> <span style="color: #cccccc">data:</span> <span style="color: #cd00cd">02</span><span style="color: #cccccc">:</span><span style="color: #cd00cd">38</span><span style="color: #cccccc">:</span><span style="color: #cd00cd">55</span> 
<span style="color: #cccccc">Traceback</span> <span style="color: #cccccc">(most</span> <span style="color: #cccccc">recent</span> <span style="color: #cccccc">call</span> <span style="color: #cccccc">last):</span> 
    <span style="color: #cccccc">File</span> <span style="color: #cd0000">&quot;/hoxxxtroller.py&quot;</span><span style="color: #cccccc">,</span> <span style="color: #cccccc">line</span> <span style="color: #cd00cd">55</span><span style="color: #cccccc">,</span> <span style="color: #cdcd00">in</span> <span style="color: #3399cc">&lt;</span><span style="color: #cccccc">module</span><span style="color: #3399cc">&gt;</span> 
        <span style="color: #cccccc">update_xxxe(</span><span style="color: #3399cc">**</span><span style="color: #cccccc">runtime_opts)</span> 
    <span style="color: #cccccc">File</span> <span style="color: #cd0000">&quot;/hxxxne.py&quot;</span><span style="color: #cccccc">,</span> <span style="color: #cccccc">line</span> <span style="color: #cd00cd">61</span><span style="color: #cccccc">,</span> <span style="color: #cdcd00">in</span> <span style="color: #cccccc">uxxxine</span> 
        <span style="color: #cccccc">results</span><span style="color: #3399cc">.</span><span style="color: #cccccc">append(module</span><span style="color: #3399cc">.</span><span style="color: #cccccc">runme(</span> 
    <span style="color: #cccccc">File</span> <span style="color: #cd0000">&quot;/hxxxxr.py&quot;</span><span style="color: #cccccc">,</span> <span style="color: #cccccc">line</span> <span style="color: #cd00cd">55</span><span style="color: #cccccc">,</span> <span style="color: #cdcd00">in</span> <span style="color: #cccccc">runme</span> 
        <span style="color: #cccccc">dfxxxxor</span> <span style="color: #3399cc">=</span> <span style="color: #cccccc">cxxxxe</span><span style="color: #3399cc">.</span><span style="color: #cccccc">fetch_data(</span> 
    <span style="color: #cccccc">File</span> <span style="color: #cd0000">&quot;/hoxxxxx.py&quot;</span><span style="color: #cccccc">,</span> <span style="color: #cccccc">line</span> <span style="color: #cd00cd">397</span><span style="color: #cccccc">,</span> <span style="color: #cdcd00">in</span> <span style="color: #cccccc">fetch_data</span> 
        <span style="color: #cccccc">query_result_item</span> <span style="color: #3399cc">=</span> <span style="color: #cccccc">query_result[</span><span style="color: #cd0000">&#39;items’] </span>
<span style="color: #666699; font-weight: bold">KeyError</span><span style="color: #cccccc">:</span> <span style="color: #cd0000">&#39;items’ </span>
<span style="color: #3399cc">&gt;&gt;&gt;</span>
</pre></td></tr></table></div>

The lines towards the end with items' </span> has a non standard apostrophe that won't simply copy paste and look nice in a foolproof editor like vim. Can you please replace this with a standard apostrophe character. Thanks.

Here is what characters vim translates this to. Clearly this should not ever happen when copying and pasting ascii character code. items□~@~Y </span>

If it's not any trouble, you could also let the HTML viewer/selector work as an editor and I'd just fix it before my initial copy. There is a lot of additional value for a user like me if you let that work, and then rendered from the current state of the text box after I edit it.