These are some readers' responses. Read the full article to see what all the fuss is about.
-
Popular
Categories
- .Net & C# (1)
- Architecture (3)
- C++ (5)
- Coding (4)
- Copyright, etc. (3)
- HTML/CSS (2)
- Java (14)
- JavaScript (6)
- JUnit (3)
- Recommendations (10)
- Risks (8)
- Software projects (2)
- SQL (4)
- Testing (6)
- Tools (5)
- Usability (2)
- Web (5)
- Web publishing (16)
- Windows (1)
- WordPress (27)
367 responses
Other comment pages: « 1 2 [3] 4 5 6 7 8 9 10 11 … 19 »
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.
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.
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.
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, 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.
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”>.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:
Thanks again!
$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.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.
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?
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!
Other comment pages: « 1 2 [3] 4 5 6 7 8 9 10 11 … 19 »