Code Monkey home page Code Monkey logo

hilite.me's People

Contributors

alexkay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hilite.me's Issues

API does not use divstyles when using GET/POST method

I've looked at the code and in my opinion the problem lies in main.py in line no 85:

divstyles = request.form.get('divstyles', get_default_style())

it should be

divstyles = request.values.get('divstyles', get_default_style())

On webpage it works, because you use also value for divstyles stored in cookie, but it's not the case when using API

Best Regards,
Chris

Site is offline

Not sure if expected or not and whether this is the best place to report it, but the site is not responding anymore.
It was still working yesterday.

hilite.me Site Would Benefit with Update to latest Pygments

I make use of the hilite.me website frequently for preparing code snippets to post to my course websites and find it quite useful! However, I am now finding that it is out of date with the latest JavaScript languages features and this seems to be because it is built against an earlier version of Pygments.

Specifically, ES6 string-templates (which are pretty ubiquitous these days and handy) do not highlight correctly with the web site. I did a local build of the code here on github and ran the dev server and it looks like the latest version of Pygments does support this syntax (and your code picks up those newer features without needing any changes)! It also picked up several new color schemes provided by Pygments without changes (very nice)!

I'm happy to just keep running it locally when I need it but I just thought I would bring this to your attention in case it's easy to update the hilite.me website. There could, in theory, be lots of other small language changes like this that are being missed just because it's built against and older version of Pygments.

Current hilite.me site:

Example from hilite.me

My local dev build:

Example from dev build

Feature: Add a button for "Copy To Clipboard"

I use this app daily, and it would save a lot of time if there is a shortcut button for copying to clipboard.

It seems that no one is maintaining this project, I would be happy to contribute for this change if it will be merged.

Swift

Is there a possibility to add support for Swift?

Form submits to `data:,` on Chrome V55 after first submit when including HTML with JavaScript

In Google Chrome (version 55, Windows 7 Pro) the action attribute of the <form> tag changes from / to data:, if you include HTML and JavaScript in the code snippet, and after the first time you submit the form.

Steps:

  1. Go to http://hilite.me

  2. Enter the following code in the snippet editor:

    <button type="button" data-action="remove">Remove Phone</button>
    
  3. Click the "Highlight" button

  4. Open the developer console and inspect the <form> tag

  5. The action attribute is now data:, instead of /

This causes the page URL to change to "data:," in the browser when clicking the "Highlight" button again.

In Firefox and Internet Explorer, the action attribute remains /.

Background color in API

The HTML generated by the API always returns background:white which overrides the hex valued background attribute earlier defined (by the selected theme/style) in the inline CSS for the main div . I'm using your API for a Chrome extension, would love to see this fixed.

Rich (BB Code) for Forums

Hello,

This webapp is nice for adding code on blogs and websites. It usability can be increased if the code can be generated in BB code as well to insert nicely formatted code in forums.

Best Regards

Tabs

Reusability of the HTML you generate would be tremendously easier if you did not use tabs as whitespace. The simplest possible characters when ANY confusion or conflict could arise, such as the basic keyboard apostrophe, spaces, and line returns, should always be the only characters in any code. This choice never results in issues down the road, it is a wonder to me when these issues come up, because there is absolutely no reasonable explanation for why they occur.

Nonstandard apostrophe character

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.

Some SQL Snippets Do Not Work

I am having trouble where I can get some SQL queries to be beautified but other ones won't (they just go to a "This webpage is not available" page with an error "ERR_CONNECTION_RESET" in Chrome.

Works: select test from test
Doesn't: select * from test
Doesn't: SELECT test, testing, testings FROM testable.thing ORDER BY test OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

Any ideas why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.