Markdown Parsing Problem with Netlify CMS

Hi there!

I’m having parsing problems with copy/pasted rich text content on Netlify CMS. It’s an issue happens in every few months that I have to fix the it manually because Netlify doesn’t build the app after the client create new content.

I share below the latest .yaml data preventing the app from building. I checked it with both a YAML and a Markdown validator, and it seems it’s valid. From the error message guessed it’s something to do with kramdown. Can someone enlighten me about the issue, because I couldn’t figure it out.

Here is the error I got from build --verbose.

error build/event/resimli-kitap-okumasi-ida-nin-yolu-deutsch-turkische-kinderbuchlesung-beim-ostlichter-festival/index.html

undefined method `link_to' for #<Object:0x000000010f44e5c0>

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/middleman-core-4.4.0/lib/middleman-core/renderers/kramdown.rb:52:in `convert_a'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:71:in `block in inner'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:70:in `each'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:70:in `inner'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:93:in `convert_p'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:71:in `block in inner'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:70:in `each'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gem== Request: /event/herkes-icin-yoga/index.html

s/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:70:in `inner'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:373:in `convert_root'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/html.rb:58:in `convert'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/kramdown-2.3.1/lib/kramdown/converter/base.rb:107:in `convert'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/middleman-core-4.4.0/lib/middleman-core/renderers/kramdown.rb:17:in `evaluate'

/Users/ozan/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/tilt-2.0.10/lib/tilt/template.rb:109:in `render'

/Users/ozan/workspace/kuko_new/config.rb:94:in `markdown'

/Users/ozan/workspace/kuko_new/source/event.html.erb:22:in `__tilt_13880'

I found the answer on the thread below, you need to pass a context to the helper method:

def markdown(text)
  Tilt['markdown'].new(context: @app) { text }.render
end

In case you’re looking for such a thing: I’ve got a couple of starter templates with examples on my github (featuring that exact bit of code, actually)

Thank you @tomrutgers,

I checked your Github and realized that already using your template. But your code doesn’t pass this (context, @app) to the Tilt.new function. Therefore I had to add it.

Thanks a lot.

Ah, I thought I did, but it seems I forgot to update one of my templates. The webpack one (which kinda became my standard) does pass context:

I see, I guess this one is more contemporary because of webpack, isn’t it? Maybe I’ll switch to it completely.

Thanks a lot.