Git Product home page Git Product logo

crayon-syntax-highlighter's People

Contributors

akazakou avatar andrewhazelden avatar aramk avatar dakatsuka avatar darricktheprogrammer avatar djennadhamza avatar dokenzy avatar fuxy22 avatar gsemet avatar imzack avatar itfiend avatar ksubileau avatar mcmanigle avatar meligy avatar mixprotocol avatar rehansaeed avatar rmc47 avatar rob006 avatar springsup avatar sumhat avatar szepeviktor avatar tamershlash avatar toszcze avatar tst avatar vhf avatar vkostyukov avatar warrenseine avatar xavier-figueroa avatar zeveisenberg avatar zhenjie 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  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

crayon-syntax-highlighter's Issues

Line number not retina compatible

This is not an issue with icons, since they're not icons.

But rather, for some reason the line numbers are smaller than the default font size in an iPod Touch, the latest version.

In other words, you can say a single line of code covers a line and a half of line numbers.

That is all.

- Eduan

Not working when post published with XMLRPC

Hello,

highlighting not working when I add post to blog with XMLRPC protocol.
Example:
http://testowe.binhoster.com/2012/08/test-xmlrpc-posting-2/

If I go to post and push 'Update' button by hand then highlighting start working again:
http://testowe.binhoster.com/2012/08/test-xmlrpc-posting/

Best regards

P.S. I added post with Python code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods import posts

client = Client('http://exampleblog.com/xmlrpc.php', 'login', 'password')

post = WordPressPost()
post.title = 'Test xmlrpc posting'
post.content = """
<pre title="Test title">
some code
</pre>

[html title="Some HTML code"]
<a href="http://www.example.com">Test link</a>
[/html]
"""
post.post_status = 'publish'
post.id = client.call(posts.NewPost(post))

Crayon effects < > in post

Turning on Crayon syntax highlighter caused the code snippets on my posts to become corrupted (all <,>,", etc.. HTML codes were escapted). Worse yet, simply hitting 'preview changes' in the code editor caused these corrupted posts to be saved to the db.

Plans for VimL syntax?

Just wondering if there are any plans on adding VimL syntax highlighting? I'm not able to add it myself, but if somebody was capable I would appreciate it, since I show lots of VimL in my blog. ๐Ÿ˜‰

Thank you!

  • Eduan

preg_match() error

Warning: preg_match() [function.preg-match]: Empty regular expression in .../wp-content/plugins/crayon-syntax-highlighter-beta/crayon_wp.class.php on line 619

...and no crayons worked at all!

Documentation issues for theme makers

  • The classes .n and .f don't have a clear meaning, how do you invoke them? How do you achieve them in code and/or in the editor.
  • The classes .p and .ta are not described at all. In this documentation.
  • I wasn't able to find the class for integers... If you know which one it is, it's supposed to have the following color, the Solarized dark/light colorscheme: #2aa198
  • For some reason true/false is not recognized as a constant or boolean if inside a function call. (E.g. functionName(true, false, 1) true/false are the same color as the rest of arguments...)

Those are some issues I ran across, thought I would open a new topic so you can look into them. ๐Ÿ˜‰

jQuery $ not defined

I just upgraded your plugin to the latest version, and it's causing some conflict with the javascript window jquery object.

This is the error:
Uncaught TypeError: Property '$' of object [object Window] is not a function

and the error is appearing anywhere there is a:
$(document).ready(function() {});

in the other scripts...

Posts without code don't show crayons in comments

Hi there,

Thanks for awesome plugin but i have a problem with Crayon.

If i have a post without code, Crayon don't load, this ok. But when i get a comment with code to this post, Crayon don't work on standalone comments.

But if i add some little code like echo "hello world" to post, crayon load properly, show post's and comment's code.

How i can enable Crayon for "only" comments.
Note: crayon on comments selected in option panel.

Thanks

THANK YOU!

Sorry for all caps title. ๐Ÿ˜‰

This is just meant to be a big thank you post/issue. Where I just say thank you for everything!

Thanks for everything! For making this awesome plugin which really is the best currently available. And thank you very much for doing this for free except for the donations (which I will provide when I can). ๐Ÿ˜„

Eduan out.

Server error after changing WPLANG

Having Crayon activated causes:

define('WPLANG', 'de_DE');

to fail and give a server error 500.

Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /Users/Aram/Development/Web/crayon/wp-admin/includes/update.php on line 16

Multiple jQuery instances

Causes crayon.js style functions to go missing when the second instance of jQuery takes precedence.

VimL: Incorrect language definitions, I think...

Here's directly from Vim, the one below is Crayon:
Screen Shot 2013-01-01 at 9 43 14 AM
Screen Shot 2013-01-01 at 9 42 58 AM

You might have noticed, but it's all messed up. :P

Also the black quotes, I'll make another issue for those. I would personally fix this in the language files. But honestly I never understood the difference between "keyword", "reserved", "special" etc.

Here's another example, the one above is Crayon:
Screen Shot 2013-01-01 at 9 49 11 AM
Screen Shot 2013-01-01 at 9 49 30 AM

Improve YAML lang file

1 : key: va:lue is parsed as :

  • key => key
  • operator => :
  • key => va
  • operator => :
  • value => lue

instead of

  • key => key
  • operator => :
  • value => va:lue

2 : <tag: lala, 2012: string> is not handled properly.

3 : key: va\lue is not handley properly

PR provided for these 3 issues.

Monospace font in the code editor

I love the code editor, so beautifully integrated. My only gripe is that it uses a proportional font.

Screen Shot 2013-01-19 at 15 03 38

This makes it very hard to line up things when you want to make small changes.

A one line CSS change could turn it into this:

Screen Shot 2013-01-19 at 15 04 52

Is that possible?

Directory permissions

mkdir is causing issues, so I've used wp_mkdir_p in the latest commit. People having issues with the theme editor should try downloading the latest zip in the master branch.

Ending XML tags are added in the source code

Suppose I'm writing this :

[java]
Set<ajavabean> set = new HashSet<ajavabean>();
[/java]

Then after an update this snippet becomes :

[java]
Set<ajavabean> set = new HashSet</ajavabean><ajavabean>();
[/java]

Delay Box Return to Original Size

The mouseover resize of the box seems to be working fantastic!

I notice you've got a feature that says: "Delay hiding the toolbar on MouseOut" that works perfectly too!

You might want to make that delay include the return to default size. I don't see a reason to have two seperate settings. It'd just be interface clutter and more code. But you should definitely have the toolbar delay also include the box's return-to-default-size so that there is some grace for mouse-piloting errors.

On my end, it looks like the box is instantly shifting to the resized state, as well. Is it just super fast or is there no css 3 transition on it? It'd be nice if it was a little slower and smooth. CSS 3 transistions really impress users. :)

  • Jim

Code blocks icons not Retina compatible

Hi,

I recently had the opportunity of testing my website in an iPod Touch, the latest version.

I noticed that the icons for selecting all of the code for example, they are not retina compatible. In other words if seen in a retina display they will be blurry, which is not HD or nice eyecandy if you're a retina user.

That is all. :)

- Eduan

Tag 2.0.2

Hi aramkocharyan

According my Wordpress backend I should update Crayon-Syntax-Highlighter to version 2.0.2
Since I have my Wordpress installation in Git with a subrepository to your extension I only update through a checkout of the new tag... but 2.0.2 does not exist yet.
Can you also tag the newest version in Github please?

regards,
Hans

Notice: ... on the Front-End

Notice: Undefined property: WP_Query::$post in /wp-includes/query.php on line 3017
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3385
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3387
Notice: Trying to get property of non-object in /wp-includes/query.php on line 3389

Inline Styles Broken

Mark a selection of code in a paragraph in Crayon with the Inline attribute, no display changes are made. My unqualified opinion is the crayon.js is not converting the crayon syntax to proper css tags?

This is the html:

<span class="font:monospace decode-attributes:false lang:php decode:true crayon-selected crayon-inline ">SubUnit.new</span>

Add option to not render any HTML code inside code tags

This problem actually originates from the bbPress 1 to bbPress 2 importer, and I've reported it here:
http://bbpress.trac.wordpress.org/ticket/1967

However, I figured I'd throw this up here in case you might have a simple workaround for it.

So we're using Crayon for syntax highlighting in bbPress 2, but our forum posts are populated with HTML tags, like this: http://i.imgur.com/TWMBl.png

I'm wondering if there might be an easy way to create an option for Crayon to simply ignore HTML tags altogether, not rendering the tags themselves nor their output.

Also I don't know why it outputs stuff like &#8220 for quotes when the post appears to be using plain quotes, not HTML:
http://i.imgur.com/iiX6z.png
http://i.imgur.com/kNxyI.png
Yet, if I "Toggle plain code" I get this:
http://i.imgur.com/68ZM5.png

insert css and js only when used

Now the css and js file it's loaded also when in the page are not used the shortcode.
It's possible insert it only when it's used for improve the performance of the site.

Solrazied color scheme

Hi, just wanted to say.

Would it be possible to add the Solarized color schemes? Light and dark versions?

I would be interested in doing this myself, if I could just get some documentation on what each thing does and highlights. :)

- Eduan

Uncaught ReferenceError: CrayonSyntaxSettings is not defined

I'm using this plugin with W3 Total Cache on my blog. If I enable JS minify the highlighter gives JS errors in the console:
Uncaught ReferenceError: CrayonSyntaxSettings is not defined

Because of this error other plugins doesn't work propper too (in my case the Shareaholic SexyBookmark plugin).

I hope you can fix this so I can re-enable the JS minify function from W3 Total Cache!

Suggestion: Adding a theme "Maintainer" field to theme header

I wanted to add the idea of adding a "Maintainer" field to the theme's info.

Right now the theme header is like this:

/*
Theme Name: Solarized Dark
Description: Clean, crisp and colorful. 
Version: 1.0.0 Beta 2
Author: Ethan Schoonover
Author URI: http://ethanschoonover.com/
*/

I suggest adding a Maintainer so that it ends up like this:

/*
Theme Name: Solarized Dark
Description: Clean, crisp and colorful. 
Version: 1.0.0 Beta 2
Author: Ethan Schoonover
Author URI: http://ethanschoonover.com/
Maintainer: Eduan Lavaque
Maintainer URI: http://eduantech.com/
*/

This way the author of the theme, and the author of the port for Crayon Syntax Highlighting, thus the Maintainer.

Theme Editor: When using custom code quotes get all messed up

You might have noticed it in the other issue I created, but some of the quotes are black, and some other spots are messed up (maybe).

Here's a screenshot I took directly from Crayon:
Screen Shot 2013-01-01 at 9 41 08 AM

Not only some of the quotes are black, but also some of the text itself is black! This is using XHTML as the fallback language, using some PHP code.

That is all, hope it is an easy fix. :)

Crayon should prefix minitags by <pre> in the HTML editor, otherwise indentation is lost

Syntaxhighlighter Evolved is doing that with some Javascript tricks :

look at the syntaxhighlighter_mce.js it seems they are using some regexp to transform the text when switching from one view to the other.

(function() {
    tinymce.create('tinymce.plugins.SyntaxHighlighterPlugin', {

        init : //...
        getInfo : //...

    // Private methods
    _visualToHtml : function(content) {
        content = tinymce.trim(content);    
        // 2 <br> get converted to \n\n and are needed to preserve the next <p>
        content = content.replace(new RegExp('(<pre>\\s*)?(\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]*?\\[\\/\\3\\])(\\s*<\\/pre>)?', 'gi'),
        function(a) {
            a = a.replace( /<br \/>([\t ])/g, '<br \/><%%KEEPWHITESPACE%%>$1' );
            return a + '<br /><br />';
        });
        content = content.replace(/<\/pre>(<br \/><br \/>)?<pre>/gi, '\n');
        return content;
    },

    _htmlToVisual : function(content) {
        content = tinymce.trim(content);

        content = content.replace(new RegExp('(<p>\\s*)?(<pre>\\s*)?(\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]*?\\[\\/\\4\\])(\\s*<\\/pre>)?(\\s*<\\/p>)?', 'gi'), '<pre>$3</pre>');
        content = content.replace(/<\/pre><pre>/gi, '\n');

        // Remove anonymous, empty paragraphs.
        content = content.replace(/<p>(\s|&nbsp;)*<\/p>/mg, '');

        // Look for <p> <br> in the [tag]s, replace with <br />
        content = content.replace(new RegExp('\\[(' + syntaxHLcodes + ')[^\\]]*\\][\\s\\S]+?\\[\\/\\1\\]', 'gi'),
        function(a) {
            return a.replace(/<br ?\/?>[\r\n]*/g, '<br />').replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<br />');
        });

        return content;
     }
};

//...

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.