johannschopplich / kirby-highlighter

šŸŒ Server-side syntax highlighting for the code block & KirbyText
https://kirbyseo.com
MIT License
20 stars 4 forks source link

Exclude kirby-highlighter in komments #20

Open MaluNoPeleke opened 1 year ago

MaluNoPeleke commented 1 year ago

I use the komments plugin from @mauricerenck and there seems to be a comment in queue with some code snippets and this conflicts with kirby-highlighter: image

mauricerenck commented 1 year ago

Can you share some more data regarding the comment? There should be no html code in the comment body.

MaluNoPeleke commented 1 year ago

image

mauricerenck commented 1 year ago

Can you post the code? In the markdown file of the post there should be a section kommentsInbox and a sub field komment. If you could post this specific comment here, that would be good.

MaluNoPeleke commented 1 year ago
  avatar: >
    https://www.gravatar.com/avatar/6ad3fa8ce534e93a0713caee7c0f8840
  author: Peter
  authorurl: ""
  source: >
    https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren
  target: >
    https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren
  mentionof: >
    https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren
  property: KOMMENT
  komment: |
    Die ZIP Download URL hat sich Ć¼brigens (erneut?) geƤndert. Das Skript muss jetzt nach "zipball_url" greppen:

    CURRENT_GHOST_DOWNLOAD=$(curl -s https://api.github.com/repos/TryGhost/Ghost/releases/latest | grep zipball_url | cut -d '"' -f 4)
  quote: ""
  kommenttype: KOMMENT
  published: 2023-07-28 13:45:00
  status: 'false'
  verified: 'false'
  id: 568455abd2fafdd0d3e6a4e7bf06a6bc
  spamlevel: 0
MaluNoPeleke commented 1 year ago

avatar: > https://www.gravatar.com/avatar/6ad3fa8ce534e93a0713caee7c0f8840 author: Peter authorurl: "" source: > https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren target: > https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren mentionof: > https://www.peleke.de/de/blog/ghost-4-uberspace-aktualisieren property: KOMMENT komment: | Die ZIP Download URL hat sich Ć¼brigens (erneut?) geƤndert. Das Skript muss jetzt nach "zipball_url" greppen:

CURRENT_GHOST_DOWNLOAD=$(curl -s https://api.github.com/repos/TryGhost/Ghost/releases/latest | grep zipball_url | cut -d '"' -f 4)

quote: "" kommenttype: KOMMENT published: 2023-07-28 13:45:00 status: 'false' verified: 'false' id: 568455abd2fafdd0d3e6a4e7bf06a6bc spamlevel: 0

mauricerenck commented 1 year ago

Okay perfect, thank you. I feared that there was html saved with the comment (it normally is stripped away), but that isn't the case. I guess then the highlighter plugin somehow goes through all the available markdown/text fields and tries to adapt it's logic.

So I don't see what I can do here, right now. Maybe a good solution might be to provide a plugin option, where you can hand in an array with fields to be ignored?

MaluNoPeleke commented 1 year ago

Okay, then I hope @johannschopplich can jump in to support!?

johannschopplich commented 1 year ago

Hi guys, I'm glad you've found my plugin useful so far! Unfortunately I'm no longer actively developing it. You can book some consulting to let us find the bug. But since I don't use this plugin myself anymore, I won't take the time to take a look into the issue. I hope you understand that. šŸ™‚ If someone investigates the issue and finds the bug ā€“ PR always welcome!

mauricerenck commented 1 year ago

@MaluNoPeleke if you need code highlights and don't necessarily need it server side, you can use highlight.js pretty easy. I am using it on my site this way, it's just a bit of css and js code.

johannschopplich commented 1 year ago

Absolutely. I recommend Shiki though.

MaluNoPeleke commented 1 year ago

I thought I could just use/load it dynamically for pages that really use the code block and not for every page. That's why I have chosen this plugin for Kirby. Maybe it is time now to move away from it if I cannot open comments anymore for moderation.