• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 5.3.4, 5.4.2, 5.7.0, 5.6.2, 5.5.5
    • 5.3.0, 5.4.0, 5.3.1, 5.5.0, 5.4.1, 5.3.3, 5.5.1, 5.6.0, 5.5.2, 5.5.3, 5.6.1, 5.5.4, 5.5.5
    • None
    • None

      Summary

      There are some inconsistencies when trying to render the following in markdown:

      line 1
      line 2
      
      line 3
      line 4

      On CommonMark dingus, the above should be rendered as the following:

      However, on Bitbucket Server, similar markdown file will be rendered as the following instead:

          Form Name

            [BSERV-10334] Markdown Rendering Inconsistency

            1cf7ba0d1876,

            It seems my Bitbucket has no footer

            Ah, that is a good clue actually. I think you're using Bitbucket Cloud (i.e. https://bitbucket.org) rather than the self-hosted Bitbucket Server.

            I pasted your code locally into a Bitbucket Server instance and couldn't reproduce this, but I could reproduce it on Bitbucket Cloud.

            After editing the markdown file to add an additional line break above the list items, I can see it renders correctly:

            The code for which is:

            TODO
            
            * Summary of set up
            * Configuration
            * Dependencies
            * Database configuration
            * How to run tests
            * Deployment instructions
            

            Note that this is correct for Markdown, which is what Bitbucket Cloud uses, however in the CommonMark spec, it is noted that they explicitly opted to allow for this.

            In CommonMark, a list can interrupt a paragraph. That is, no blank line is needed to separate a paragraph from a following list
            [...]
            Markdown.pl does not allow this, through fear of triggering a list via a numeral in a hard-wrapped line

            I've created a bug in the Bitbucket Cloud project to track this: BCLOUD-21100, you can follow that to get updates on its progress.

            Regards,

            John van der Loo
            Developer, Bitbucket Server

            John van der Loo (Inactive) added a comment - 1cf7ba0d1876 , It seems my Bitbucket has no footer Ah, that is a good clue actually. I think you're using Bitbucket Cloud (i.e. https://bitbucket.org ) rather than the self-hosted Bitbucket Server. I pasted your code locally into a Bitbucket Server instance and couldn't reproduce this, but I could reproduce it on Bitbucket Cloud. After editing the markdown file to add an additional line break above the list items, I can see it renders correctly: The code for which is: TODO * Summary of set up * Configuration * Dependencies * Database configuration * How to run tests * Deployment instructions Note that this is correct for Markdown, which is what Bitbucket Cloud uses, however in the CommonMark spec, it is noted that they explicitly opted to allow for this . In CommonMark, a list can interrupt a paragraph. That is, no blank line is needed to separate a paragraph from a following list [...] Markdown.pl does not allow this, through fear of triggering a list via a numeral in a hard-wrapped line I've created a bug in the Bitbucket Cloud project to track this: BCLOUD-21100 , you can follow that to get updates on its progress. Regards, John van der Loo Developer, Bitbucket Server

            @John van der Loo 

            I noticed that about the extra line breaks as well, but the bottom dotpoint list (2 dot points) works without the extra line breaks.

            • It seems my Bitbucket has no footer, I had a look around all the pages you said and cant see it anywhere..
            • I viewing the readme as its own file rather than as the repository homepage also does the same displaying, also viewing the file in PRs.
            • I can't really make a minimal repro case but I can post the file that is giving me the issue (i'll just remove the sensitive information and attach it to this) http://puu.sh/HLgM8.md

            Joel Goransson added a comment - @John van der Loo  I noticed that about the extra line breaks as well, but the bottom dotpoint list (2 dot points) works without the extra line breaks. It seems my Bitbucket has no footer, I had a look around all the pages you said and cant see it anywhere.. I viewing the readme as its own file rather than as the repository homepage also does the same displaying, also viewing the file in PRs. I can't really make a minimal repro case but I can post the file that is giving me the issue (i'll just remove the sensitive information and attach it to this)  http://puu.sh/HLgM8.md

            1cf7ba0d1876 No worries.

            I can't seem to reproduce that problem The only notable difference I see is that the list that isn't rendering correctly doesn't have an extra line break between the "TODO" heading (That shouldn't matter btw, it should render correctly regardless of that).

            A few more questions:

            • Could you tell me what version of Bitbucket you're working with there? (it should say so in the footer of the application, visible on pages like the repository list, source view, and your profile.
            • Are you able to reproduce this elsewhere in Bitbucket (e.g. comments or pull request descriptions)?
            • Are you able to make a minimal reproduction case? (and if you could post your minimal reproduction's code or even better attach the whole file)

            Regards,

            John van der Loo
            Developer, Bitbucket Server

            John van der Loo (Inactive) added a comment - 1cf7ba0d1876 No worries. I can't seem to reproduce that problem The only notable difference I see is that the list that isn't rendering correctly doesn't have an extra line break between the "TODO" heading (That shouldn't matter btw, it should render correctly regardless of that). A few more questions: Could you tell me what version of Bitbucket you're working with there? (it should say so in the footer of the application, visible on pages like the repository list, source view, and your profile. Are you able to reproduce this elsewhere in Bitbucket (e.g. comments or pull request descriptions)? Are you able to make a minimal reproduction case? (and if you could post your minimal reproduction's code or even better attach the whole file) Regards, John van der Loo Developer, Bitbucket Server

            @Jon van der Loo Sorry about that I saw they were broken but had to go into a meeting, I've updated it with links now

            Joel Goransson added a comment - @Jon van der Loo Sorry about that I saw they were broken but had to go into a meeting, I've updated it with links now

            1cf7ba0d1876 unfortunately I can't see your screenshots. Could you share in a code block what your markdown looks like?

            John van der Loo (Inactive) added a comment - 1cf7ba0d1876 unfortunately I can't see your screenshots. Could you share in a code block what your markdown looks like?

            Joel Goransson added a comment - - edited

            I am experiencing inconsistent rendering of dotpoint lists, my README file is rendering my bullet lists on the same line, even though they are all consistently laid out the same way, some work and some don't.

            Problem: http://puu.sh/HL2Ih.png

            The raw text: http://puu.sh/HL2Is.png 

             

             

            Joel Goransson added a comment - - edited I am experiencing inconsistent rendering of dotpoint lists, my README file is rendering my bullet lists on the same line, even though they are all consistently laid out the same way, some work and some don't. Problem: http://puu.sh/HL2Ih.png The raw text: http://puu.sh/HL2Is.png      

            Kalle Niemitalo added a comment - - edited

            I see the Markdown syntax guide has been updated.

            In Bitbucket Server 5.6.2, "Contribution guidelines" in the pull request screen still render Markdown soft newlines as HTML <br> elements. As I am unable to reopen this issue, I have filed a support ticket instead.

            Edited on 2018-01-15 to add: The bug with "Contribution guidelines" is BSERV-10554.

            Kalle Niemitalo added a comment - - edited I see the Markdown syntax guide has been updated. In Bitbucket Server 5.6.2, "Contribution guidelines" in the pull request screen still render Markdown soft newlines as HTML <br> elements. As I am unable to reopen this issue, I have filed a support ticket instead. Edited on 2018-01-15 to add: The bug with "Contribution guidelines" is BSERV-10554 .

            Kalle Niemitalo added a comment - - edited

            Markdown syntax guide of Bitbucket Server 5.6 still says:

            Paragraphs are separated by empty lines. Within a paragraph it's possible to have a line break,
            simply press <return> for a new line.

            For example,
            like this.

            Is this documentation going to be changed when Bitbucket Server 5.6.2 is released? Can I preview the changes somewhere?

            Kalle Niemitalo added a comment - - edited Markdown syntax guide of Bitbucket Server 5.6 still says: Paragraphs are separated by empty lines. Within a paragraph it's possible to have a line break, simply press <return> for a new line. For example, like this. Is this documentation going to be changed when Bitbucket Server 5.6.2 is released? Can I preview the changes somewhere?

            GitHub seems to behave differently, even though the GitHub Flavored Markdown Spec doesn't outright say so. The raw file for https://github.com/git-lfs/git-lfs/blob/v2.3.4/README.md contains Markdown soft line breaks and GitHub renders them in HTML as line endings, not as <br /> tags.

            I want to add soft line breaks between sentences in Markdown files because that lets "git blame" show the origin of each sentence, rather than each paragraph.

            Kalle Niemitalo added a comment - GitHub seems to behave differently, even though the GitHub Flavored Markdown Spec doesn't outright say so. The raw file for https://github.com/git-lfs/git-lfs/blob/v2.3.4/README.md contains Markdown soft line breaks and GitHub renders them in HTML as line endings, not as <br /> tags. I want to add soft line breaks between sentences in Markdown files because that lets "git blame" show the origin of each sentence, rather than each paragraph.

            I am sorry for confusion caused by my comment. I should have not mentioned this workaround. "markup.render.hardwrap" is an internal undocumented property, and it is not guaranteed that it will work as expected in all configurations.

            We believe that implementation provided by default is correct, and other similar products handle soft line breaks in the same way. However, we will take this suggestion into consideration next time we will work on the markdown functionality.

            Andrei Khudavets added a comment - I am sorry for confusion caused by my comment. I should have not mentioned this workaround. "markup.render.hardwrap" is an internal undocumented property, and it is not guaranteed that it will work as expected in all configurations. We believe that implementation provided by default is correct, and other similar products handle soft line breaks in the same way. However, we will take this suggestion into consideration next time we will work on the markdown functionality.

              tbowden@atlassian.com Trent Bowden (Inactive)
              vchoo Vivian C
              Affected customers:
              5 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: