aramk / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/crayon-syntax-highlighter/
GNU General Public License v3.0
1.1k stars 248 forks source link

Visual Editor doesn't show code from URLs #209

Open sr105 opened 10 years ago

sr105 commented 10 years ago

In WordPress 3.9.1 with Crayon 2.6.5, if you pull your code from a url, the visual editor doesn’t show the code (but the post does). I’m not sure if that’s intentional or not. Here’s an example (screenshot and code):

pastedgraphic-1

Our stream reader class is XmlRateReader which parses the rates from a given xml file.
<pre class="lang:c++ range:7-22 decode:true" title="Stream Reader" data-url="https://raw.githubusercontent.com/sr105/international_trade/master/xmlratereader.h"></pre>

The mapping from the xml works like this:
aramk commented 10 years ago

That's intentional, in that the feature to pull the code isn't implemented. The URL still appears in the attributes of the pre tag and can be modified of course, but we would need to insert the content, keep it read-only and then strip it out on save. Alternatively, we could display a hyperlink instead of the blank box. Which would you prefer?