• Resolved tintinhh

    (@tintinhh)


    I am using a theme that puts variables in the code outside of brackets. When using wp-typography these variables disappear:

    <section …bla bla> == $0

    is changed to

    <section …bla bla> ==

    How can I prevent wp-typography from doing so?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author pepe

    (@pputzer)

    When should these variables be parsed? You can prevent processing by wp-Typography by using <span class="notypo"></span> around the $0. However, I’m not sure why they would be stripped in the first place if they are just text literals. I think I’d need to see a live sample page somewhere to diagnose the problem.

    Or are you talking about PHP variables? If so, it’s a PHP problem somewhere, not directly related to wp-Typography. Enable debug logging and add some calls to check if and where those variables are set/unset.

    • This reply was modified 8 years ago by pepe.
    Thread Starter tintinhh

    (@tintinhh)

    Sorry, obviously something different happens. I had a closer look at the code and found this:

    The website is feinschliff.hamburg. On https://www.feinschliff.hamburg/nails/ is a section with a background image with this code, wp-typography off:

    <section id="main-content" class="container">
    <!-- Start Page Content -->
    <div class="row-wrapper-x"></div></section><section class="blox aligncenter  page-title-x  " style=" padding-top:px; padding-bottom:px;  background: url('https://www.feinschliff.hamburg/wp-content/uploads/2014/09/nails_02.jpg') no-repeat ; background-position: center center;background-size: cover; min-height:px; ">

    wp-typography on:

    <section id="main-content" class="container">
    <!-- Start Page Content -->
    <div class="row-wrapper-x"><section class="blox aligncenter  page-title-x  " style=" padding-top:px; padding-bottom:px;  background: url('https://www.feinschliff.hamburg/wp-content/uploads/2014/09/nails_02.jpg') no-repeat ; background-position: center center;background-size: cover; min-height:px; ">

    The closing div and section tag after the first div are missing. Any idea?

    Plugin Author pepe

    (@pputzer)

    Not directly from the snippet, but wp-Typography works by parsing the HTML code into a DOM, processing the nodes and then printing new HTML. So it might either be a bug in the parser (possible, but unlikely regarding “standard” block-level elements like <section> and <div>) or some incorrect nesting in the content preceeding the posted snippets, which the parser tries to fix.

    I just tried validating the page and it appears there are some spurious <br> tags inside a <ul>. It is possible that the parser does not like that.

    Thread Starter tintinhh

    (@tintinhh)

    Well the affected div does not have any <br> tags. I think, the parser “thinks” the nesting is incorrect and “fixes” these issues. Unfortunately that leads to the unwanted result. Is there a chance to switch off the correction so that the html itself is left untouched?

    Plugin Author pepe

    (@pputzer)

    You can add the class “notypo” to the affected diffs.

    I just noted something: The embedded CSS in your style attribute is invalid. Is that the real code or a C&P error?

    • This reply was modified 7 years, 12 months ago by pepe.
    Plugin Author pepe

    (@pputzer)

    I’ve added some tests with the given snippet. As is, it fails similar to your experience. The reason for this is that the last section has no closing tag. When I add the closing tag, the output remains unchanged.

    Thread Starter tintinhh

    (@tintinhh)

    Cool, thanks very much for your help. Maybe I should give this information to the author of the theme as well ??

    Thread Starter tintinhh

    (@tintinhh)

    hm. I can’t find a missing closing tag. where did you put it in?

    Plugin Author pepe

    (@pputzer)

    In your snippet, the section element containing the background image has no closing tag. This might be a c&p error, though.

    Thread Starter tintinhh

    (@tintinhh)

    Here is, what happens:

    plugin not activated

    <!-- end-header -->
    
    <section id="main-content" class="container">
    <!-- Start Page Content -->
    <div class="row-wrapper-x"></div></section>
    <section class="blox aligncenter  page-title-x  " …

    plugin activated

    <!-- end-header -->
    
    <section id="main-content" class="container">
    <!-- Start Page Content -->
    <div class="row-wrapper-x">
    <section class="blox aligncenter  page-title-x  " …

    The first section and div are closed correctly, while the plugin is not activated. When the plugin is activated, the closing tags disappear.

    Plugin Author pepe

    (@pputzer)

    I get that, however, the snippet as-is is not well-formed. To check for a parser bug, I need a complete minimal example.

    • This reply was modified 7 years, 12 months ago by pepe.
    Thread Starter tintinhh

    (@tintinhh)

    I could give you access to the backend of the site, but I would prefer to do so via Mail.

    Plugin Author pepe

    (@pputzer)

    That should not be necessary. Just send me a complete HTML sample to test. (Leave me a comment at https://code.mundschenk.at/wp-typography/ and I’ll contact you via mail.)

    Plugin Author pepe

    (@pputzer)

    Fixed in v3.5.2.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Unwanted parsing of variable’ is closed to new replies.