nested tags interrupt the sumTagLess counter #58

Closed
jbeach opened this Issue Jan 3, 2013 · 1 comment

Comments

Projects
None yet
2 participants

jbeach commented Jan 3, 2013

I recently implemented this plugin (version 1.4.5) , as follows:

// slicePoint: 235
<div class="expandable">
  <p>
    Can your students apply Gibbs Free Energy equation? Gain insight into your</p>
  <ul>
    <li>
      <u><em><strong>students' prior knowledge and</strong></em></u></li>
    <li>
      <u><em><strong>misunderstandings of Building Block A to help you select</strong></em></u></li>
    <li>
      <u><em><strong>activities that build their ability to make predictions about changes in free energy availability at the molecular and cellular level.</strong></em></u></li>
  </ul>
</div>

With this example, I discovered that the first nested opening tag without a space in front of it (<em>) is treated as a text character in the while (summTagless < o.slicePoint) loop and the rest of the summary text counting is then thrown off. This really showed up in differences between FFX and IE8 because of additional markup attributes in IE8 which were being treated as text.

It seemed to fix the problem when I updated the rTagPlus regex to account for nested tags:

OLD: rTagPlus = /^<[^>]+>.?/
NEW: rTagPlus = /^(<[^>]+>)+.?/

After my local fix, both FFX and IE started slicing the summary at the desired 235 text characters.

Thanks for writing such a great plug in!

Owner

kswedberg commented Jan 4, 2013

thank you so much for the report and for proposing a solution! I will try to incorporate it into the plugin as soon as I get a chance.

@kswedberg kswedberg closed this in 3bef56c Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment