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

Crash when text starts with --- #99

Open
amadeu01 opened this issue Nov 17, 2020 · 2 comments
Open

Crash when text starts with --- #99

amadeu01 opened this issue Nov 17, 2020 · 2 comments

Comments

@amadeu01
Copy link

When we attempt to create a new SwiftyMarkdown using one string that starts with the characters --- it will break.
It does not happen if you have something before the ---, such as . ---

How we are currently using the lib ⤵️

            let markDown = SwiftyMarkdown(string: text)
            self.descriptionLabel.attributedText = markDown.attributedString()

It might be related to ⤵️

static public var frontMatterRules = [
		FrontMatterRule(openTag: "---", closeTag: "---", keyValueSeparator: ":")
	]
@ellstang
Copy link

ellstang commented Jan 7, 2021

I am the same issue in my project too
Have to implement a string checking and insert a transparent character in the beginning of the string (if the first three characters are ---)

@cometheart314
Copy link

I have the same issue with the frontMatterRules.

What is the frontMatterRules?

If the string that start with "---", the contents between the start "---" and the next "---" are all gone in the result attributed text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants