Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line break in Markdown string is considered to be code block. #5319

Open
RokeJulianLockhart opened this issue Feb 26, 2024 · 0 comments
Open
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Feb 26, 2024

Description

Line breaks in a Markdown string (`") causes all except the text before the line break to not be rendered, and reports "Unsupported Markdown: code".

Steps to reproduce

https://develop.git.mermaid.live/edit#pako:eNqtV8mOGzcQ_RVCFyeCpIy8JPYgMGDEDmwgixEPkkM6wFDskpoZNtkh2ZLl5d_ziouWmTGQQ3wYS1yqXlW9ekV9nCjX0uRysjZupzrpo7h62djG2uWfzeT6J7m7biZ_ifn8ufj0vX7-WpOXXnX7TyI84mNhmfd-d5HCJ2GXWHp4d-nJ3aWnd5awOK42Xg6dCMsLdj-d_iKjdlYsp1PsxxdW0PtI3kojBiMVdc605IXNp3adVh1O6BCDiE601DsbopeRROxkFIY20pj9TEiTrGA9Xw1CehJyZYjvJQvCjTHolm-SWLnRtkG4tSiALhbitdvRlvwMbglnvJB2fzCst9X0V-FrETo3mrbYLV9WJBQcw4OnVij4X4_AtuA8IFIRCJsMyJMM8Lh2XoQR8cka7gGpDmLo9kGrkEwiYG2RgeBgBAhL8O2YgkPabjgQudJGxz0v4VKUKiKA9ht4GbzbcuDZJlItQ4AbaVUywPnICGZCR9GPQLBx8GPxNZBZL8Sr9wOpiLC0PXEzZTDTgze241LiSjwIQ4qg41i-1oLGjneGwWgKMzGQ7-QQhF6zd-wg3C0Zo-0GV-AmDCCGQMASqTO0lTaKvGRbhnGyDEAW7oxoS3wLZntjybaZ3Bdivph_gfkHrj46o-pFpuoVg2Z0h2ydRtM6NfbwDYoG5fWKwkK8OaUGX-sdMjuAZR7MqEYI6XM9l8X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HSfva7ZwwzjFkANrYciJOjK-8k1zXrQ5JDhHyg0wrfrS00reVVwBbqJgfQxkLKJl7CmKLChUnZ6p6qqsPs67-IWFS_JwOc8mOenqi-Lt0qD8cql0SblnHFGW5TkN7KbLpH5wxqYj5ZD333e1zL3UYkAt_ZvAw3M6xP8nYf9T-_4T-lK0WTGx6jTcEcnt9DvzZyanr_wL2aQaL31jilYUCqTtgy3LAo313F1b-jVQ8vpXRc0Jvo1ouj_m8B9St5wL-TGYTyF0vdYtfhR_5zddMwLWemsklPoJuN82ksZ9xDm8o925v1eQS3UWzyThwY7zUEgH2k8u1NIE-_wuYz0Ks

Screenshots

mjbvz/vscode-markdown-mermaid#243 (comment)

image

Code Sample

flowchart TD

n1["`Law`"] --> |<i>Hierarchy| s3

s1 --> |Votes| n1
s2 --> |Votes| n1
s5 --> |Votes| n1
s8 --> |Votes| n1

subgraph s10["`**Nation 1**
	An external placeholder nation which exists to demonstrate that legally, alternate nations are able to exist outside the bounds of Nation 0. However, whether any alternative nation(s) should exist should be considered carefully.

	A sensible reason for such a nation to exist is physics constraints so severe that due to lack of ability to contact and/or provide physical assistance to the nation, it must govern itself. Expected inability to *ever* contact the other nation is a situation in which this applies, perhaps if it is travelling into space at a relevant pace and to a relevant eventual distance.`"]
end

s10 -.- |<i>Hierarchy| s3

subgraph s3["`**Nation 0**
	This is the nation which this document describes. It should be the most powerful nation economically and militarily in order to prevent invasion, in order to sustain its meritocratic and just institutions.`"]

    subgraph s1["`**Administration Authority**
		Provides administration to its ultimately separate subordinates.`"]

	    n3["`**Rank 0 Administration Officer**
			This role is the highest authority - the head of state.`"]

		n3 --> |<i>Hierarchy| s9

		subgraph s9["`**Administration Innovation Authority**
			Innovates methods of improvement of administration of its subsidiaries.`"]

		end
	end

	s1 --> |<i>Hierarchy| s4

	subgraph s4["`**Product and Service Improvement Authority**
		Provides competition against, and mutually advantageous co-operation with, private organizations.`"]

		subgraph s6["`**Public Service Authority**
			To ensure healthy competition, a singular public entity would be established to compete with private companies. Subordinate entities would be created in a federal manner to compete in specific sectors such as food, clothing, and basic digital devices. The more specific the need, the more entities would be the entity's parent, unless its purview does not fit into the systems of the existent entities, in which case it could without problem be subservient solely to the ultimate parent despite being niche.

			This system aims to enhance affordability, quality, and customer service by fostering market competition, because whereas the private system when comprised of small companies is incapable of *not* innovating in the short term in order to survive, the government would take the role of traditional private monopolies, yet would instead use that power to slowly enhance the quality of its development systems and products by utilizing the innovations of the private sectors. It *would* improve due to its federal structure - accountability goes up the chain to the head of state, and consolidates those with similar interests into groups able to demonstrate their competence yet managed by those with broader visions. It's the standard system of competing interests, but properly managed.`"]

			subgraph s2["`**Waste Management**
				Provides waste management services.`"]

				n6["Rank 1 Waste Collector"]
				n7["Rank 1 Waste Disposer"]

			end

			subgraph s5["`**Fire Management**
				Provides waste management services.`"]

				n8["`Rank 1 Firefighter`"]
				n9["`Rank 1 `"]

			end

			subgraph s8["`**Law Enforcement**
				Enforces law.`"]

				n10["`Rank 1 Patroller`"]
				n11["Rank 1 "]

			end
		end
	end
end

Setup

Mermaid version

I use https://github.com/mjbvz/vscode-markdown-mermaid/blob/bc6dfff7d69202b62be271f8a1bd34a7df9ab920/README.md#markdown-preview-mermaid-support:~:text=currently%20supports%20mermaid%20version%2010.8.0, which "Currently supports Mermaid version 10.8.0".

Browser and Version

  1. code-insiders-1.87.0-1708582258.el8.src

    Version: 1.87.0-insider
    Commit: a0b90ac5e04ea9a0733b68062253a469994e170e
    Date: 2024-02-22T05:47:39.416Z
    Electron: 27.3.2
    ElectronBuildId: 26836302
    Chromium: 118.0.5993.159
    Node.js: 18.17.1
    V8: 11.8.172.18-electron.0
    OS: Linux x64 6.7.5-1-default

  2. and https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/MozillaFirefox-122.0.1-1.1.x86_64.rpm

Suggested Solutions

Simply allow newlines. Markdown doesn't process them as indentation, even in indented lists:

1.	Placeholder
	
	Placeholder

Additional Context

This cannot be worked around using Markdown line breaks, because that reports "Unsupported Markdown: break". Additionally, https://github.com/orgs/mermaid-js/discussions/4575#discussioncomment-8586213 may be of note.

@RokeJulianLockhart RokeJulianLockhart added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant