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

Allow formatting post content without the HTTP request #1848

Merged
merged 2 commits into from
Sep 3, 2019
Merged

Allow formatting post content without the HTTP request #1848

merged 2 commits into from
Sep 3, 2019

Conversation

matteocontrini
Copy link
Contributor

@matteocontrini matteocontrini commented Aug 17, 2019

Fixes #1840

Changes proposed in this pull request:
This change allows the formatContent() method on the CommentPost to be called without an HTTP request.

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run php vendor/bin/phpunit).

@luceos
Copy link
Member

luceos commented Sep 2, 2019

As the code shows, you can also use the Formatter directly to render. That's why I'm in dubio..

I see this is based on an existing issue. Let's wait for either @clarkwinkelmann or @franzliedke to pitch in.

@clarkwinkelmann
Copy link
Member

Indeed, it's not an absolutely needed change because it can be done without using this method.

But I think the change is so simple, it would be counter-productive to not allow re-using that method in every contexts. It makes extensions easier to develop by not having to resolve the formatter yourself. It's easier to explain how to use it, and it's also maybe easier to read code that uses the method.

@franzliedke franzliedke merged commit 1d43371 into flarum:master Sep 3, 2019
wzdiyb pushed a commit to wzdiyb/core that referenced this pull request Feb 16, 2020
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.

Allow calling formatContent() on a CommentPost without passing a request
4 participants