0

This is an idea that came through my mind, and I would like to know if possible and how to approach it if so...

I have my own wordpress framework that I use as based for all my projects, I manage the content position generated in the content box using shortcodes which respond to an especific div with a location...

Said this, sometimes I find myself into a mess really hard to understand, for sample:

[one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column] [one_column] content [/one_column]

when the among of text is big, is hard to find where the shortcodes are placed.

So, is there any way to highlight the shortcode (like with a different color) into the content box? or maybe easier, is there any way to indent the content and keep that indent once I save or update the post?

I would like to hear you opinion,

Thanks in advanced.

Kind Regards.

1 Answer 1

1

The only way I can think of doing this is with JavaScript to regex your parameter and apply a css style to them on the fly.

Check out these jquery plugin for ideas:
https://github.com/jbr/jQuery.highlightRegex
http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html

2
  • thanks a ton, looks like what I'm looking for! I'd appreciate you help Commented Apr 3, 2012 at 7:42
  • hi @andrewkthx - did you ever get this working? if you did i'd love to find out how! i've tried jQuery highlight with a regex (/\[.*\]/ig), it works in other places but not in the editor. Commented Jan 21, 2013 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.