cuttlebelle / cuttlebelle

The react static site generator that separates editing and code concerns
https://cuttlebelle.com/
GNU General Public License v3.0
550 stars 27 forks source link

Markdown parsing of list broken in 1.0.0-alpha.59 #53

Closed pabloa closed 5 years ago

pabloa commented 5 years ago

Hello!

We were happy Cuttlebelle users from version v1.0.0-alpha.57 now. I would like to require if you have release notes.

When we started using v1.0.0-alpha.59, our site was wrongly generated. I think version v1.0.0-alpha.58 was OK (from our point of view) but version v1.0.0-alpha.59 had issues with sub lists and graphs.

Example:

# Example Contents

  1. [Setup](#Setup)
  1. [Basics](#Basics)
    1. [Testing connectivity and parameters](#Testing connectivity and parameters)
  1. [example_exception.json)](#example_exception.json))
    1. [Lookup the company's record.](#Lookup the company's record.)
  1. [Push Notifications API](#Push Notifications API)
  1. [Setup connection parameters.](#Setup connection parameters.)
    1. [Define a handler](#Define a handler)
    1. [More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff ](#More stuff More stuff More stuff More stuff More stuff More stuff More stuff )
  1. [More stuff API](#More stuff  API)

You could try to render it with both versions of cuttlebelle to see the difference (and brokeness)

dominikwilkowski commented 5 years ago

Hey @pabloa Fair question. As this is still running as a alpha semver version I did not start a CHANGELOG file. I can provide you with the changes though.

I just tested your markdown:

cuttlebelle@1.0.0-alpha.57

screen shot 2019-02-28 at 10 59 27 am

cuttlebelle@1.0.0-alpha.59

screen shot 2019-02-28 at 10 59 20 am

So this seems to be a bug and I'm concerned it didn't get caught in my test suit. I will fix this now.

Thank you for the report

dominikwilkowski commented 5 years ago

Actually I just checked this and the markdown you provided is not valid. Links can't have spaces in them and one of them had too many closing brackets.

The older version of marked was more forgiving I guess. I cleaned it up for you and it works now in all versions.

# Example Contents

  1. [Setup](#Setup)
  1. [Basics](#Basics)
    1. [Testing connectivity and parameters](#testing_connectivity_and_parameters)
  1. [example_exception.json](#example_exception.json)
    1. [Lookup the company's record.](#lookup_the_companys_record)
  1. [Push Notifications API](#push_notifications_api)
  1. [Setup connection parameters.](#setup_connection_parameters)
    1. [Define a handler](#define_a_handler)
    1. [More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff ](#more_stuff_more_stuff_more_stuff_more_stuff_more_stuff_more_stuff_more_stuff)
  1. [More stuff API](#more_stuff_api)
# Example Contents

  1. [Setup](#Setup)
  1. [Basics](#Basics)
-    1. [Testing connectivity and parameters](#Testing connectivity and parameters)
+    1. [Testing connectivity and parameters](#testing_connectivity_and_parameters)
-  1. [example_exception.json)](#example_exception.json))
+  1. [example_exception.json](#example_exception.json)
-    1. [Lookup the company's record.](#Lookup the company's record.)
+    1. [Lookup the company's record.](#lookup_the_companys_record)
-  1. [Push Notifications API](#Push Notifications API)
+  1. [Push Notifications API](#push_notifications_api)
-  1. [Setup connection parameters.](#Setup connection parameters.)
+  1. [Setup connection parameters.](#setup_connection_parameters)
-    1. [Define a handler](#Define a handler)
+    1. [Define a handler](#define_a_handler)
-    1. [More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff ](#More stuff More stuff More stuff More stuff More stuff More stuff More stuff )
+    1. [More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff More stuff ](#more_stuff_more_stuff_more_stuff_more_stuff_more_stuff_more_stuff_more_stuff)
-  1. [More stuff API](#More stuff  API)
+  1. [More stuff API](#more_stuff_api)

I know this caused a bit of confusion. I hope this makes it clear. I will close this issue now but please feel free to continue talking here and even reopen it if I have missed something.

pabloa commented 5 years ago

Well. I guess I have to replace " " with %20 or something. It is not "legal" according to specs, but the browser, IntelliJ mark down editor and other tools do this replacement task automagically.

Thank you for your fast response.

dominikwilkowski commented 5 years ago

Mh maybe I file a bug report on the marked repo when I get to it.