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

Add md_line Twig filter to expose Markdown::parseLine() #370

Merged
merged 1 commit into from
Dec 6, 2021
Merged

Add md_line Twig filter to expose Markdown::parseLine() #370

merged 1 commit into from
Dec 6, 2021

Conversation

matteotrubini
Copy link
Contributor

@matteotrubini matteotrubini commented Dec 6, 2021

If accepted, also docs should be updated accordingly.

@LukeTowers
Copy link
Member

Could you provide an example of this being used and why it would be used?

@matteotrubini
Copy link
Contributor Author

{{ 'Hello _Parsedown_!'|md }} would print <p>Hello <em>Parsedown</em>!</p>

{{ 'Hello _Parsedown_!'|md_line}} would print Hello <em>Parsedown</em>!

Currently if I don't want to enclose the text inside a paragraph I cannot use |md, so I must use html and |raw.

As the method parseLine() already exists I think that can be convenient to make it available via filter.

@LukeTowers LukeTowers added Status: Completed maintenance PRs that fix bugs, are translation changes or make only minor changes labels Dec 6, 2021
@LukeTowers LukeTowers added this to the v1.1.8 milestone Dec 6, 2021
@LukeTowers LukeTowers merged commit 0a5f67e into wintercms:develop Dec 6, 2021
@matteotrubini matteotrubini deleted the twig-filter-md_line branch December 7, 2021 09:52
LukeTowers added a commit that referenced this pull request Dec 9, 2021
* develop: (90 commits)
  Define signature for "defineProperties" method
  Add definition of "componentDetails" method
  Update `system` french lang files (#366)
  Update `backend` french lang file (#364)
  Update `cms` french lang file (#365)
  Fix clear color picker function, allow empty value
  Trigger "change" event on color picker when value changes
  Use better cursors for readonly color picker
  Adjust "force" option for plugin:remove
  Require explicit confirmations for CLI deletions
  Add PHP 8.1 option, drop other details field
  Add md_line Twig filter to expose Markdown::parseLine() (#370)
  Don't use the Cache facade in the service provider registration process.
  Fix return type hints for CMS Page and Controller (#362)
  Fixes typo in list of available encodings for importing
  Improved Ukrainian translation (#360)
  Constrain PHP version >= 7.2.9 and 8.0.x (#361)
  Improve Latvian translation (#358)
  Docs UI Fix paths to screenshots of diagrams (#359)
  Coerce Inspector set values to string
  ...

# Conflicts:
#	composer.json
#	modules/backend/composer.json
#	modules/cms/composer.json
#	modules/system/composer.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PRs that fix bugs, are translation changes or make only minor changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants