getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

Kirbytextinline doesn't parse most of Kirbytext & Markdown #4776

Closed mrflix closed 1 year ago

mrflix commented 1 year ago

Description

Kirbytextinline seems to be broken. Running the following code or it's deviations ($field->kirbytextinline() and kirbytextinline()) doesn't parse headlines, lists and quotes:

<?php echo $page->text()->kti() ?>

Kirbytext without inline works correctly.

Expected behavior

All kirbytext should get parsed.

Screenshots

The link gets parsed (made it visible by unsetting the color and text-decoration in the starterkit). Other things don't get parsed:

Screenshot 2022-10-10 at 13 44 18

To reproduce

  1. Checkout latest starterkit (at time of writing: Kirby 3.8.0)
  2. Add<?php echo $page->text()->kt() ?> to snippets/intro.php
  3. Edit content/home/home.txt and add:
----

Text:

# Test

(link: https://google.com text: Link to Google)

## List

- First
- Second

## Quote

> Lorem ipsum nulla eu ut sit cupidatat culpa anim ut in veniam.

Your setup

Kirby Version

distantnative commented 1 year ago

@mrflix I don't think this is a bug. You are choosing the methods/helpers that are for parsing inline Markdown/Kirbyytext. But then you throw at it text that isn't inline at all but all kinds of paragraphs, headlines, blocks... that kind of negates what the inline method is meant to return.

Why would you not use the normal kirbytext methods for your case?

mrflix commented 1 year ago

That makes total sense 🙈 for me kti was always kt but without the paragraphs around the content. Obviously, headlines don't make sense here.