http://www.damianc.pl/wp-content/themes/damianc/cphp.png
I've blog based on WordPress, I use plug-in SyntaxHighlighter Evolved. In my posts first codes has empty space in Chrome, but in IE hasn't [image]. How fix it?
I don't think the issue is fixable.
I have run into FireFox/Chrome/IE formatting issues working as a Software Developer, and the issue was in the underlining HTML structure. Each browser would interpret the HTML code differently.
You might be able to fix the issue if you can change the HTML that is sent to your posts. If not, I would recommend getting a different code formater. WordPress has a built in format for code triggered by,
<code> your code here </code>
or
<tt> your code here </tt>
See link for more detail: Writing Code in Your Posts
Related
I have a problem when I use the fromHtml function jspdf he only writes the first page in the PDF , the rest appears as blank pages.
In older versions of the plugin do not, the problem that these versions do not have css and are not compatible with images, I need it in my project .
I am very grateful if anyone can solve or know a solution.
I came across the same problem.
See jsPDF multi page PDF with HTML renderrer it may help you solve the problem. I am working on it now.
I have been documenting some C++ codes (or can be any codes) over the past few months on wordpress, with the Syntax-highlighter-evolved plugin. Everything had worked fine. e.g. the C++ codes displayed correctly in post. e.g. the following syntax would display C++ codes nicely in wordpress.
[code language="cpp"]
c++ codes goes here...
[/code]
Recently, I have started exploring using mark-down in wordpress and started writing mark-down in new posts with the wp-markdown plugin. (For the benefits of simplicity and ease of migration / sharing / maintenance in long term).
... And then ... I realized all of my older posts (with codes wraped in the Syntax-highligher-evolved syntax) have all got corrupted!
For example, characters (like < > etc), got converted into HTML entities (like < > etc). In addition, I also see LOADS of HTML tags being inserted into the C++ codes.
See here for a sample post on my wordpress site (scroll down to and you will see some code blocks.). It contains some supposingly C++ codes which now looks nothing like C++ codes.
Following discovering this error I have attempted playing around with activating and deactiving the plugins to see if I could get back to the working state (i.e. codes being displayed as C++ codes, instead of hybrid C++/HTML code). No luck so far.
(Currently I have both syntax-highlighter-evoled and wp-markdown plugins activated).
Has anyone encountered similar problems before and how did you resolve this?
Would be very grateful for all the help!
UPDATES (Monday 2nd March 2015):
As a workaround I have (1) disabled the wp-markdown plugin. (2) Kept the syntax-highlighter-evolved activated. (3) Activated the Jetpack markdown plugin. The manual workaround steps below helped me correct 1 (out of about 100) posts.
It looks like the Jetpack markdown plugin complement better with the syntax-highlighter-evolved plugin. (based on my observations so far.)
As an experiment, I have modified manually an old post by (1) turning the wordpress visual editor off. (2) edited that old post. Here are the new vs old.
when I started editing the old post, I noticed that the entire post was converted automatically to mark-down format in the editor (which is good). The good news was, the unexpected HTML tag now had gone away (I presume because I was using the bare minimum wordpress editor, instead of the visual editor). So at least I could recover / copy the entire chunk of markdown-like post to a text editor (like sublime text on my desktop).
This conversion was not perfect however - I noticed some by-products. such as...
lots of carriage return (i.e. new line) disappeared - causing multiple lines got "merged" into one line. I had to manually spot for these lines and re-format them one-by-one. (a pain!)
I noticed also things like #include appeared as # include (added space in the middle). So I had to manually correct those. Likewise for some other entities containing #.
To manually edit the old (now semi-markdown) post, I removed all the legacy syntax-highlighter open tag [code language="cpp"] to three back-tick plus the code extension (```.cpp). And the close tag [/code] to three back-tick (```). See the Jetpack Markdown Doc and Markdown Extra Doc for more info.
Once updated post with the new Jetpack markdown syntax, the syntax-highlighter-evolved seemed to "know" about these new tag and automatically apply c++ color coding to it. (if I use three back-tick without the code extension, the syntax-highlighter still work to wrap the code into a block, just without the color).
Net net. The good news is that I have found a workaround which will enable me to "upgrade" the post one-by-one, manually (and a way to recover old posts - i.e. no more unexpected HTML tags in code by disabling the wordpress visual editor). Downside: this will be a lengthy process as I will have to manually spot for the missing carriage-return and re-add them to the code block. Updating 100 posts like this will take... some time.
Update (7th March 2015)
Realized that the WP-plugin actually corrupt the original blog post files. So as a quick fix I manually edited the 100 posts using the editor, and replaced all the damaged code with the corrected version. Took me 3 days solid to do but at least corrected.
I noticed that the Jetpack Markdown Plugin and/or the Syntax Highliter Evolved are not perfected. e.g. even wraping a code with the opening and closing code tags, some bugs remained - such as backslashes got stripped, the less-than / greater than signs not displayed as expected, etc.
So I for creating new posts, I have tried out the (Github) Gist in conjunction with oEmbed Gist plugins (as suggested by #OllieJones below). Works beautifully so far (Gist seem to display codes as expected. Time will tell). I have this feeling that going forward I can use Gist to store all of my blog posts in markdown files, and simply use Wordpress to "display" these markdown files. (I wonder if Gist can be used to store the image files as well? Or I need to stick to Wordpress to store the image files?).
Here are some sample new blog posts using the Gist method. example1, example2.
The doggone markdown plugin translates posts from HTML to markdown when it loads them for editing, and translates them back when you Update them. I've had the same problem with code getting trashed. This is a big pain. (I fixed it with a backup.)
My solution is to use gists -- on http://gist.github.com/ -- to display my code. The oEmbed Gist plugin makes that work very well.
Sorry I am to late.
You can edit the "SyntaxHighlighter" plugin.
open "SyntaxHighlighter" plugin, edit it
wordpress will open syntaxhighlighter.php
search and romove all "htmlspecialchars" and "htmlspecialchars_decode" string.(maybe you need backup it)
save it
I used this fixed success.
My Englist is bad, but I tried my best, hope that may help for you
Expanding on Pea3nut answer, I had to modify the PHP file for SyntaxHighlighter Evolved so it ended like this
Go to Plugins -> Plugin file editor -> Select SyntaxHighlighter Evolved on the top right -> Copy the gist in the link above -> Select all and paste it there (replace it)
This also fixes the issue with Divi, so you don't have to pay for the Divi syntax highlighter code plugin and save $9 (it's free)
I am using the plugin WP Cufon on my Wordpress website, however, the font is not displaying in Firefox. Chrome and Safari are working fine. Can't seem to figure out what the issue is. Looking at the source, it is loading everything, just not displaying...
http://gonuttzo.com
Any help would be soooo appreciated! This is driving me batty.
Thanks in advance!
Cufón doesn’t work in Firefox, but works in other browsers
Cause
This issue is almost certainly caused by an empty stylesheet () in your HTML, which causes Cufón’s CSS load detection to fail. This has been happening in recent versions of Firefox only, and seems to occur a lot with purchased WordPress templates. Note that this snippet will cause your browser to load and use your front page as a stylesheet. It’s pretty much the same as href="/". Extra slowness for zero gain.
Solution
Search your HTML for empty stylesheets. Note that the markup on your site may differ from the example, but searching for href="" might save you some trouble. Also, make sure to use the actual HTML (e.g. View Source in your browser) while doing this, if you only go through your template files the issue might be very difficult to spot as the empty href can be masked by, for example, a variable that has an empty value or a function call that returns an empty value.
Short Version:
I am using Chrome 27.0.1453.94 on Windows 7 Pro
I go to http://www.try-phpbb.com/30x/ using Chrome
I select Print... | Save as PDF
The print preview looks nothing like the web page - layout, links, fonts all wrong.
Why?
How can I fix this to make the PDF styled the same way as the web site?
Long Version:
I am a member of a secure forum (ie have to log in for access), which is base on the phpBB forum template (https://www.phpbb.com/). Our forum will be cleared of all threads and posts soon to make room for the next round of subscribers.
We have been given permission (even encouraged) by the moderators to download the contents of each topic/thread/post and write them into PDF files so we can keep referencing them in the future. We have to do this ourselves, and I volunteered to do the work as I have an IT background. But its proving harder than I thought.
I was hoping to do the following this process...
Download and add "Stylish" Chrome Extension
(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe)
Add CSS code to Stylish to modify the appearance of the forum pages ready for PDF migration
In Chrome use Print | Save as PDF option to save styled page as a PDF doc
For multi-page forums, repeat this process for each page and then use PDFMate (or similar) to concatenate the PDF docs together into a single long PDF.
Steps 1, 2 and 4 are working perfectly, but step 3 is not.
The print preview in Chrome screws up the appearance of the forum pages. Layout styling is lost, fonts are completely different, links are missing or look terrible. For example, try printing this page (http://www.try-phpbb.com/30x/) - it looks completely different in print preview to how it looks in the browser.
Is there something I can do to fix this? Can I somehow give the print preview version some CSS code to restyle it? Anyone know why this would be happening?
Or alternatively, can you suggest another solution to convert HTML to PDF? I have tried Chrome extensions "iWeb2x" and "Send to Google Drive", but with no success - because the forum is secured, the PDF file they create is the forum's Login page, not the forum thread page I'm currently looking at.
Any help greatly appreciated - thanks.
Have a look here, maybe it's helpful
http://www.smashingmagazine.com/2011/11/24/how-to-set-up-a-print-style-sheet/
You can set your own css style for the printed page.
Hope it helps, regards
I had a case, where if the iframe is display:none, the css is not loaded, thus not printing the correct CSS style. You can fix it with visibility:hidden; And size zero
I am using WordPress 3.4. with only the plugins that come with the wordpress default installation.
My problem is that I cannot add any links or html to my posts from the editor.
It seems that wordpress is filtering all code off and I can only add text.
I've also tried to embed code via the html tab but again the code just gets wiped out.
Any ideas of why this could be happening?
Adding HTML code in the HTML text-area should be fine alright, but it will strip some codes if it's not written in valid HTML. Can you paste the code you've been trying to add?
I hope I am correct in thinking that you mean switching between the visual and HTML editors. I ran into this as well, a few weeks ago, and after researching for over an hour it seems that this is just how the editor works.
Searching Google for " html stripped wordpress editor " will bring up results for this, going back to 2008.
My research led to me installing Preserved HTML Editor Markup and TinyMCE Advanced, to ensure that no html/code is stripped when saving a draft, or switching editor modes.
After installing the plugins, you will have to make one setting change for TinyMCE Advanced. In the admin area, navigate to 'Settings > TinyMCE Advanced'. Under Advanced Settings, check this setting.
Your HTML code should no longer be stripped when switching between the editors or saving a draft. If this isn't what you were referring to, sorry!
Plugins:
http://wordpress.org/extend/plugins/preserved-html-editor-markup
http://wordpress.org/extend/plugins/tinymce-advanced
(I would have used hyperlinks but I need 10 reputation to use more than two hyperlinks in a post.)