Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Preview does not accurately represent published state #638

Open
ThomObarski opened this issue Jul 19, 2019 · 4 comments
Open

Preview does not accurately represent published state #638

ThomObarski opened this issue Jul 19, 2019 · 4 comments
Labels
bug When something isn't working correctly

Comments

@ThomObarski
Copy link

The markdown previewer does not always represent what winds up being published. Have seen issues with smart quotes or in the case of embedded video (issue #492 ) we can wind up with a page that doesn't publish with errors not visible on the previewer, or stripped out content per this example

@germsvel
Copy link
Contributor

Thanks for bringing this up Thom! I was thinking about this recently. The problem comes from the fact that we use two different libraries to turn markdown into html -- one in javascript for the preview and the other one in elixir -- the one that actually publishes this.

@mjankowski
Copy link
Contributor

My guess here:

  • The original version of constable probably used the same JS renderer for both preview and show views
  • At some point when we refactored/simplified things it became two separate renderers

It is now in fact true that we are using slightly different rendering rules for the preview vs the show view, and I wouldn't be surprised if the preview is "more liberal" (strips less out) than the show view.

Other than "do a once over on both renderers and try to make them closer" or "make the preview step require a form submit and use the elixir renderer instead of JS", I'm not sure what else to try.

@germsvel
Copy link
Contributor

Something I've wanted to try that would fix this is to use Phoenix LiveView to handle the preview. We'd essentially be doing the same thing this example of Phoenix Live View is doing -> http://markdown.dichev.io/

@georgebrock
Copy link

This also seems to effect strike-through (which is very important for bad jokes in Constable posts).

When previewing an announcement, ~single tildes~ render as strike-through. After an announcement has been published, ~~double tildes~~ are needed.

@WilHall WilHall added the bug When something isn't working correctly label Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug When something isn't working correctly
Projects
None yet
Development

No branches or pull requests

5 participants