September 10, 2013 at 2:53 pm #29380
Hello all! Love the theme so far, but running into two small issues using the layout builder.
Background – In my portfolio entries, I’m trying to put in some code syntax highlighting. I’m specifically using the Crayon Syntax Highlighter Plugin (http://wordpress.org/plugins/crayon-syntax-highlighter/). Normally, the code highlighting setup has to be done using the “Text” tab in the “Default Editor” and displays in a popup.
Issue One – The only Content Element that makes sense for me to use (am I wrong with this) is the Text Box. I add the text box and when clicking on the Text Box to set its contents, I can’t use the crayon syntax highlighter, since it can’t display a second-layer modal. Is there a preferred method to do this? Right now, I open a second post and use the default editor, copy the code it creates, and paste it into my Text Box contents. It works, but is there another, smoother way?
Issue Two – the code the syntax highlighter creates is encapsulated within a
<pre>tag with its inner elements. If highlighting HTML or XML, the containing code is encoded into html-encoded entities. When saving the post, I see that the database stores the code correctly (still using the HTML-encoded entities). But when I edit the post again, those entities are converted back into normal HTML-tags, breaking the theme builder and the final saved post.
Example: my code inserted into the Text Box is (and how it is saved into the database) is:
<pre>& lt;something& gt;can go here& lt;/something& gt;& lt;/pre& gt;
(added in spaces to prevent the forum from automatically converting them here too)
However, when I open the edit for the post, the entities are converted back into normal HTML, breaking the code highlighting and everything else, and looks like this in the editor:
<pre><something>can go here</something></pre>
Any thoughts or suggestions? Issue #1 can be worked around, so no biggie, but #2 is a show-stopper for right now.September 11, 2013 at 5:05 pm #140519
I have never found WordPress code or pre to be very good so I typically put my code into gists and then add the gist code into my personal site. It may work for you as a temporary solution as I’m not sure what can be done to keep the pre data in place but I’ve tagged the head of support and Kriesi on the issue.
DevinSeptember 12, 2013 at 2:51 am #140520
Thanks Devin! I thought about doing gists, but I have a lot of one or two liners throughout my examples and figured it was more overhead than what it was worth. I can do that in the meantime, but it’d be nice to have some sort of content option that just left pres alone.
Thanks!September 13, 2013 at 11:00 am #140521September 18, 2013 at 2:14 am #162639
In theory I was able to solve the issue with tag encoding. However I will probably not include it in the next patch tomorrow since I had to change string encoding in a few places that could affect a lot of other elements as well. Once i have worked for a few days with the modifications active I will be able to tell if it causes any issues, and if it doesnt we will add it to Enfold Version 2.3 :)
Cheers!October 1, 2013 at 2:44 am #168514
Hey there! I just wanted to check in and see if this was included in the update that was just released. I just tried it out and still saw the same results. So, am guessing it wasn’t. I appreciate all the work you put into the theme! It really is a great product!October 1, 2013 at 9:59 am #168649
No it wasnt yet. I am not 100% comfortable with the changes yet and also found a bug that I wasnt able to fix by now. But we are getting there and one of the next releases will definitely get the update ;)
KriesiOctober 4, 2013 at 3:39 am #170252
No worries at all! Just wanted to check in. For the meantime, I’m using Devin’s recommendation and just using gists. It’ll work for now, but I look forward to your release.
Thanks for the great work!October 9, 2013 at 6:59 pm #173191
The topic ‘Preformatted Text in Layout Builder’ is closed to new replies.