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

Render markdown preview on the server #3859

Merged
merged 1 commit into from
Jun 16, 2021
Merged

Conversation

jasonvarga
Copy link
Member

Instead of using the marked JS library to generate the markdown fieldtype's preview, it'll now use an AJAX request to generate the preview on the server.

This lets us preview using any custom markdown parsers, which is more accurate with what you'd see on the frontend. (Closes statamic/ideas#442)

It's also going to be necessary in #3850 which is going to add support for ID-based statamic:https:// image URLs. If we continued to a JS preview, those would 404 since they wouldn't be the actual image URLs.

Copy link
Member

@jesseleite jesseleite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beauty!

@jasonvarga jasonvarga merged commit e613893 into 3.1 Jun 16, 2021
@jasonvarga jasonvarga deleted the feature/markdown-preview branch June 16, 2021 16:10
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.

Render Markdown previews on server via AJAX so custom parsers can be used
2 participants