karnov / htmltoword

Ruby html to word gem
MIT License
179 stars 71 forks source link

Lines containing both strong and br tags, get trimmed #38

Open mupkoo opened 8 years ago

mupkoo commented 8 years ago

The content gets trimmed whenever a line contains both strong and br tags.

For example

<html>
<head></head>
<body>
    <h1>Title level 1</h1>
    <hr>
    <h2>Title level 2</h2>

    <h3>Title level 3</h3>
    <div>
        <p>
            <strong>Bold label one</strong> - around 120.<br>
            <strong>Bold label three</strong> - around 90.<br>
            One more line here
        </p>
    </div>
</body>
</html>

Removes everything after the br tag, but only for the current p tag. Here is the result: screen shot 2015-12-03 at 11 56 32

But once I remove the strong tags, everything gets rendered as expected.

<html>
<head></head>
<body>
    <h1>Title level 1</h1>
    <hr>
    <h2>Title level 2</h2>
    <h3>Title level 3</h3>
    <div>
        <p>
            Bold label one - around 120.<br>
            Bold label two - around 90.<br>
            One more line here
        </p>
    </div>
</body>
</html>

screen shot 2015-12-03 at 11 57 05