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

[9.x] feature: Str::inlineMarkdown() #43126

Merged
merged 3 commits into from
Jul 11, 2022
Merged

[9.x] feature: Str::inlineMarkdown() #43126

merged 3 commits into from
Jul 11, 2022

Conversation

danharrin
Copy link
Contributor

@danharrin danharrin commented Jul 11, 2022

Currently, Str::markdown() wraps all content in a block element <p> when converting.

For certain layouts, this is inconvenient, as the markdown needs to be rendered inline instead.

Commonmark has a built-in InlinesOnly extension that we can use in a Str::inlineMarkdown() method.

Additionally, I've added an inlineMarkdown() method to the fluent Stringable object to maintain consistency.

Str::markdown('Use [Laravel](https://laravel.com)!') // <p>Use <a href="https://laravel.com">Laravel</a>!</p>

Str::inlineMarkdown('Use [Laravel](https://laravel.com)!') // Use <a href="https://laravel.com">Laravel</a>!

@danharrin danharrin changed the title feature: Inline markdown helpers [9.x] feature: Inline markdown helpers Jul 11, 2022
@danharrin danharrin changed the title [9.x] feature: Inline markdown helpers [9.x] feature: Str::inlineMarkdown() Jul 11, 2022
@taylorotwell taylorotwell merged commit 8301bcd into laravel:9.x Jul 11, 2022
@danharrin
Copy link
Contributor Author

@taylorotwell do you want a docs PR for this? or are you on it already

@danharrin danharrin deleted the feature/inline-markdown-helpers branch July 11, 2022 13:00
@driesvints
Copy link
Member

@danharrin feel free to send in a PR to the docs 👍

@danharrin
Copy link
Contributor Author

laravel/docs#8039

@driesvints
Copy link
Member

@danharrin thanks!

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

Successfully merging this pull request may close these issues.

3 participants