alexcapes Posted July 26, 2017 Share Posted July 26, 2017 Hi, I have an issue when using the SmartyPants Typographer text formatter. If the text has an HTML tag (such as italics) straight after the quotation mark, it reverses it. So for example: This only seems to occur when an HTML tag is placed at the beginning. Does anyone know how this could be corrected? Link to comment Share on other sites More sharing options...
apeisa Posted July 26, 2017 Share Posted July 26, 2017 PW doesn't use latest version of the PHP SmartyPants, it uses 1.7.1 while latest is 1.8.1 Maybe updating that would fix your issue? You can try it by updating that module by yourself and maybe creating github issue or PR for Ryan to update it in Core too (shouldn't be in the core at all imo). Here you can find the llibrary pw uses: https://michelf.ca/projects/php-smartypants/ 1 Link to comment Share on other sites More sharing options...
Robin S Posted July 26, 2017 Share Posted July 26, 2017 10 hours ago, alexcapes said: If the text has an HTML tag (such as italics) straight after the quotation mark, it reverses it. I can't reproduce that. Maybe you have some odd unicode character in your text that is confusing SmartyPants? Or an unclosed open quote before the sentence in question? 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted July 27, 2017 Share Posted July 27, 2017 If you battle to get this fixed, there also an alternative: http://modules.processwire.com/modules/textformatter-typographer/ 1 Link to comment Share on other sites More sharing options...
alexcapes Posted July 27, 2017 Author Share Posted July 27, 2017 On 27/07/2017 at 0:27 AM, Robin S said: I can't reproduce that. Maybe you have some odd unicode character in your text that is confusing SmartyPants? Or an unclosed open quote before the sentence in question? Digging a bit (and by that I mean actually looking at the source!) it looks like this is not a SmartyPants issue. I can see that the double quote is being encoded by Processwire incorrectly as a right double quotation mark. <p class='review'>”<i>How Music Works </i>is a melange of bookish musings on how music is shaped by the places it is played and the technology used to create and disseminate it”<br/><span class='review-source'>Danny Eccleston<br/><em>mojo</em></span> However the data source for this content (an XML file) the quotes look just to be normal double quotes <Text><![CDATA["<i>How Music Works </i>is a melange of bookish musings on how music is shaped by the places it is played and the technology used to create and disseminate it"]]></Text> So I'm not sure why Processwire would encode (incorrectly) the first double quotation mark (if before an HTML tag) and no others? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now