Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to remove unintentionnal

Hello!

I use Twine 1.4 and Sugarcane story format.
I have a quite long text and I want to divide it in several paragraphs, so I put some <p> around like that :
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<p>Fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est.</p>

<p>Dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa.</p>

The problem is that there is a very big line-height between the paragraphs because Twine seems to add some <br/>

Is there a way to remove it ?



Comments

  • edited December 2015
    You, generally, are not expected to manually add <p> tags to your content like that in the Twine 1 vanilla story formats. If you are going to do so, then one way to remove the extra line breaks would be to add the nobr tag to the passage.
  • Further to TheMadExile's reply:

    By default Twine replaces each line-break in your passage content with a <br> element, there are three methods to remove them and depending on the story format used each method can produce slightly different results. I will list the three methods in the order I think are most effective for Sugacane.

    1. Escape the line-break using a trailing backslash:
    This method totally removes the line-breaks thus removing the br element.
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\
    \
    <p>Fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est.</p>\
    \
    <p>Dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa.</p>
    
    2. Adding a nobr tag to the passage:
    This method replaces each line-break with a zwnj HTML escape code, depending on the web-browser these characters can result in an empty line appearing between generated html elements.

    3. Using the <<nobr>> macro:
    This work very similar to point 2 except it can also result in an extra empty line appearing at the start of the wrapped content if you place the <<nobr>> macro on its own line.
    <<nobr>>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    
    <p>Fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est.</p>
    
    <p>Dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa.</p>
    <<endnobr>>
    
  • edited December 2015
    Could you use line-height in the CSS?
    p {line-height: 20px}
    

    I've not tested this. And of course the px value is up to you.

    Now tested. In Sugarcube 1 it's
    .passage {line-height: 20px}
    
  • Jud_Casper wrote: »
    Could you use line-height in the CSS?
    That's totally unrelated to their issue.

Sign In or Register to comment.