kswedberg / jquery-expander

Expand and Collapse HTML content
https://kswedberg.github.io/jquery-expander/
Other
459 stars 168 forks source link

Seems to be deleting space between consecutive words #71

Closed Gnossos closed 11 years ago

Gnossos commented 11 years ago

Maybe this is because I'm not using the plugin correctly, but with slicepoint set to 150. Consider the following text:

<div class="expandable" style="">
     <p style="">
      We will go over the content of the course, what to expect, how you will be graded, and how to succeed in the course. We will also briefly review the neoclassical theory of supply and demand applied to labor markets.
      </p>
</div>

The plugin splits the text right after "briefly review the" and before "neoclassical." But when I click the more button, this text expands to "briefly review theneoclassical." What does someone have to do to get an extra space around here?

NotARobit commented 11 years ago

You can also see the problem on the second question of example 1 on the demo page. The space between the words "loved" and "nothing" is removed.

kswedberg commented 11 years ago

Pretty sure this is fixed now. Let me know if you still have problems with the spacing.

Gnossos commented 11 years ago

On 8/30/13 4:34 PM, Karl Swedberg wrote:

Pretty sure this is fixed now. Let me know if you still have problems with the spacing.

— Reply to this email directly or view it on GitHub.

Thanks. I assume there's a modified version. I'll give it a try.

I don't know if this is closely related, but another glitch I discovered involves quotation marks. If one has text reading

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.

and wants to cut it off at the 110th character, the split comes use after "egestas id," and before "condimentum." Now consider the following:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, "condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam." Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum.

If I've counted correctly, the displayed part of the text looks like (the inserted text is my option):

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, "... more

I'd like to see the opening quote treated as part of the next word rather than as a word by itself.

Thanks again.