-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncatewords breaks in markdownify #16475
Comments
@SzymonSel are you able to provide a report for this? A test case will help identifying the issue.
|
Sorry, perhaps I wasn't too clear. What I meant was, that I'm not sure whether it's A test case scenario:
|
Instead, can you just show us what value is provided as the input and output of each filter? Example: Then we could see what the issue is. "doesn't render markdown" doesn't help |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Ok, ok! geesh!
Output 1,
Output 2,
Output 3, hacked. This is what I would expect
|
So it looks like Have you tried the actual filter named |
Yes, you are correct :) I've corrected my example - the problem still stands, though slightly different |
Output1 results look fine
So in this case it's |
No. Output 2 doesnt get "interpreted" and just displas the raw, truncated text as if mardownify didn't work. |
This is not compatible with what you wrote in the issue: I have still no idea if you are using markdownify in these examples, and if it's the case then what is the output from truncate? These should be two different concerns, and only one should be described as the issue. Your examples suggest they only use truncatewords. Skype me if you want to show what you are doing and getting. |
Repro-ing:
Outputs:
Verified on https://shopify.dev/docs/api/liquid by pasting the example above.
|
Well, but So to conclude: |
Exactly. For HTML that's why there is a filter to remove all the tags. You could contribute the same thing for markdown if you want. |
check this warning on the Shopify website for truncatewords:
|
True true. Thanks for your time Seb! |
It did! It removed the line break right before the markdown quote |
"Output 1" looks fine to me, it's "Output 2" that's lost a line break |
Sorry, didn't realize you mentioned |
{{ Model.Content.Person.About.Markdown | truncate: 400 | markdownify | raw }}
work as expedcted{{ assigned_author.Content.Person.About.Markdown | truncatewords: 40 | markdownify | raw }}
doesn't render markdown{{ assigned_author.Content.Person.About.Markdown | split: " " | slice: 0, 40 | join: " " | append: "..." | markdownify | raw }}
working workaroundWhen hacking a workaround, I've got a hunch it's something to do with the "..." ie. When I place the
append
filter at the end, then the markdown breaks.Not sure if this is a
Fluid
orOrchardCore
issue.The text was updated successfully, but these errors were encountered: