cryogen-project / cryogen-core

Cryogen's core
Eclipse Public License 1.0
69 stars 62 forks source link

`<!--more-->` markers not respected #110

Closed kyptin closed 6 years ago

kyptin commented 6 years ago

Hey, thanks for your work on Cryogen. :smile:

I noticed that <!--more--> markers are not respected for determining preview boundaries. The :blocks-per-preview configuration is used instead, even when there's a marker present. This is true whether the marker occurs before or after the :blocks-per-preview cutoff.

I confirmed that this is present in a new, current Cryogen blog. Here's how to reproduce:

  1. lein new cryogen cryogen-blog and cd cryogen-blog
  2. Change resources/templates/config.edn so that :previews? is true.
  3. Add a <!--more--> marker in resources/templates/md/posts/2016-01-07-docs.md, e.g. just before the # Prerequisites heading.
  4. Start the server with lein ring server.
  5. Note that the previews in the index page obey the :blocks-per-preview configuration and ignore the <!--more--> marker. You can change both of these things, but the behavior is consistent.

I can see that there's a test for the cryogen-core.compiler/content-until-more-marker function, and all tests pass for me in the latest cryogen-core code. So I'm guessing the function works as expected but that either it isn't being called when it should be or it's results are being dropped somewhere along the way.

lacarmen commented 6 years ago

Sounds like you're having the same problem described in #76. This is an issue with the way markdown-clj parses HTML comment tags (relevant issue here)

kyptin commented 6 years ago

Arg, I forgot to look at the closed issues before posting this. Apologies. 🤦‍♂️

Yes, that does look like the same issue. I'll close this duplicate. Thanks!

lacarmen commented 6 years ago

No worries! At least it's not a new bug. 😄