#6380 Runs of tildes within preformatted text prematurelty end preformatted text block

fixed
2015-10-09
2013-12-28
No

In the “Preformatted Text” section of the formatting help, it says “As an alternative to indenting, you can use 4 or more tildes before and after the text.” However apparently four or more tildes anywhere in a line is interpreted as the end of the preformatted text, which causes the preformatted text to end prematurely if the preformatted text itself actually contains four or more tildes!

For example, here is a an error message the clang compiler generated when trying to compile SourceForge-hosted project sdcv, about which I was trying to submit a bug report:

./src/lib/file.hpp:11:38: error: no type named 'function' in namespace 'std'
                          const std::function<void (const std::string&, bool)>& f);
                                ~~~~~^
./src/lib/file.hpp:11:46: error: expected ')'
                          const std::function<void (const std::string&, bool)>& f);
                                             ^

Even though I've used eight tildes in delimiting this preformatted text block, the block is prematurely ended by the five tildes in the error message (which are also swallowed and not displayed).

Even if I use the other method, of indenting by 4 spaces, it does not work correctly.

Please reconsider how your preformatted text detection works so that one can post preformatted text which happens to contain runs of tildes.

Discussion

  • Anonymous - 2013-12-31
    • labels: --> engr, nf-7020
    • status: unread --> assigned
    • assigned_to: Chris Tsai
     
  • Anonymous - 2013-12-31

    Greetings,

    Thank you for this report, I've confirmed this issue and on first look anyway, it's likely an issue that will need to be addressed upstream with the Markdown processor we use. Anyway, I'm escalating this to our engineering team and perhaps they can sort out a patch they can pass upstream: [allura:tickets:#7020]

    In the meantime however, another trick you can add to your repertoire is using <pre> tags (since Markdown allows in-line html). And for good measure, you can also include the appropriate styling so it'll appear in a block. So you could do something like:

    <div class="codehilite"><pre>
    code block
    </pre></div>
    

    Of course, the downside is that it doesn't get the syntax highlighting, but at least it'll display.

    With the code block from your example, this would output like so:

    ./src/lib/file.hpp:11:38: error: no type named 'function' in namespace 'std'
                              const std::function<void (const="" std::string&,="" bool)="">& f);
                                    ~~~~~^
    ./src/lib/file.hpp:11:46: error: expected ')'
                              const std::function<void (const="" std::string&,="" bool)="">& f);
    

    Regards,
    Chris Tsai, SourceForge.net Support

     
  • John Barrett

    John Barrett - 2015-10-09
    • status: assigned --> fixed
     
  • John Barrett

    John Barrett - 2015-10-09

    Hello,
    Durning a ticket review process I saw this ticket, so I apologize for the delay in my reply to this ticket. I think this is an old issue that has already been taken care of if I'm mistaken please let me know and I will take another look into your situation.
    Thanks
    SourceForge Support

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks