Code Markup: a WordPress plugin

These are some readers' responses. Read the full article to see what all the fuss is about.

367 responses

Other comment pages: « 1 2 [3] 4 5 6 7 8 9 10 1119 »

  • Thanks, Martin. I suspected that the WordPress 2 editor wouldn’t work with Code Markup. I’ll have to look into it more — I’m not sure if TinyMCE has the hooks I’d need to make it work. Only time will tell.

    Bennett | 14 January 2006
  • Trackback | ddhr.org - David Hosier | 17 January 2006
    [...] Enabled two plugins: Owen Winkler's Comment Quicktags (slightly edited) and Bennett McElwee's Code Markup. [ Mon, 16 Jan 2006 @ 12:01:45 | Upd[...]
  • I like your plugin, thanks! :-)
    Just a question: do you know if there is an easy way to modify it to have the resulting CODE section automatically put in a DIV, so that i can easily personalize the style (now i have to do it manually)? Thanks again.

    Zelig | 17 January 2006
  • No I do it manually too — I usually enclose my <code> blocks in <pre class=”code”>, and use the following styles:

    code,
    pre.code {
    font-family: ‘Lucida Console’, ‘Courier New’, Courier, monospace;
    }

    pre.code {
    color: #000;
    background-color: #eee;
    clear: both;
    }

    I have a private plugin that adds buttons to the editing screen, and I have a plan to incorporate this into Code Markup so there will be a simple button that will do the <pre class=”code”><code> all in one go (and close it automatically too). It’s on the list for the next version.

    Bennett | 17 January 2006
  • Thanks for the plugin. It’s made life a lot easier.

    Not sure if these are possible to implement (haven’t played with WordPress filtering much myself), but just a few things that came to mind: it would be nice if the allow attribute could be stripped out of the final output (ie. still displayed when editing an entry, but not included in the HTML output) as this seems to cause problems for the W3C validator (”there is no attribute ‘allow’”). Also, maybe the possibility of specifying a custom tag set inside the allow attribute value. At the moment, if I have a code block with an ‘a’ element which I don’t want rendered, but want to wrap ’span’ tags around a segment, I’m not able to do it.

    Other than that, it’s a very handy plugin. Thanks! :)

    Keyvan | 25 January 2006
  • [...] http://www.thunderguy.com/semicolon/wordpress/code-markup-wordpress-plugin/ [...]
  • Keyvan, that’s an excellent point about the validation — I can’t believe I missed this. I’ll fix it when the next version comes out. I also have thought of nice ways of customising the tag set, so that should make life easier for Code Markuppers. It will be in a future version of Code Markup, coming sometime in the medium term.

    Bennett | 3 February 2006
  • OK, at last there is a new version of Code Markup! Basically, I have implemented both of Keyvan’s suggestions. Code Markup now strips the “allow” and “lang” attributes so that your pages can still be valid (X)HTML. Also, apart from “default”, “all” and “none”, you can now explicitly specify a set of tags in the “allow” attribute. In Keyvan’s example, he’d want to use allow="span" so that the span tag gets treated as normal HTML but the <a href=”foo”> tag gets printed verbatim as <a href=”foo”>.

    Bennett | 5 February 2006
  • [...] My Code Markup WordPress plugin has been updated to version 1.1. Code Markup makes it easy to include program code samples in your posts. You ca[...]
  • Bennet, thanks so much for the changes! I had one minor problem specifying my own tags in the allow attribute, PHP didn’t like the pattern on line 112 without delimiters: $allowedTags = preg_replace('\s+', '|', trim($allow));.
    Changed to $allowedTags = preg_replace('!\s+!', '|', trim($allow)); and it’s now working just how I want it - never thought code markup in WP could be so easy. :) Thanks again!

    Keyvan | 10 February 2006
  • Dear oh dear. Thanks for spotting that — clearly it was late at night when I uploaded that old plugin file. It’s fixed now — version updated to 1.1.1.

    Bennett | 10 February 2006
  • [...] http://www.thunderguy.com/semicolon/wordpress/code-markup-wordpress-plugin/ [...]
  • [...] Source [...]
  • [...] Code Markup [...]
  • Hi,

    Everytime I post code to my blogs I get an ‘Internal Server Error’ - works finr with basic text but not code.

    It worked the first time I installed this, but right after that - its not working.

    I’ve switch off Rich Text Editor from my preferences.

    Anyone else had this problem?? and Ideas how I can fix it?

    stuart | 7 March 2006
  • [...] It’s called “Code Markup” and you can get it here. [...]
  • Hi, don’t know if you interested, but I’ve posted a solution that works quite well with the WordPress 2.0 RTE

    http://myles.eftos.id.au/blog/archives/34

    Cheers!

    Myles Eftos | 25 March 2006
  • [...] I’ve been using Scott Reilly’s Preserve Code Formatting plugin to handle most of the formatting. It eliminates the need to put your [...]
  • [...] 1. Go download and install the Code Markup plugin. 2. In the WordPress admin area, go to Options > Writing and uncheck “Users should us[...]
  • [...] I just add Markup it is a wordpress plugin that allows for placing code into a blog entry. As I am planning on posting some code, and do not wan[...]

Other comment pages: « 1 2 [3] 4 5 6 7 8 9 10 1119 »

Post your comment | RSS feed for comments
Close
E-mail It