-
Notifications
You must be signed in to change notification settings - Fork 8
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
default output breaks markdown in nested shortcodes #70
Comments
Hi Austin is your solution able to be copied and pasted into the source
code of the module? If you rung Hugo mod vendor on your project you could
copy and paste into the local module files.
If it's good to go let me know. Thanks for keeping up with Hugo's rapid
development. I appreciate the feedback and help
Regards
Sean
…On Wed, 11 Sept 2024, 9:51 pm Austin, ***@***.***> wrote:
The default output creates indents which is normally not a problem, but if
you nest it inside a shortcode that allows markdown content, hugo breaks
the image into code blocks due to indentation. I ended up making a wrapper
shortcode to trim the spacing from the output as a workaround, but can we
get an option to have this built in?
test.md
{{< div >}} {{< picture src="test.jpg" >}} {{< /div >}}
shortcodes/div.html
<div>{{- .Inner | safeHTML | markdownify -}}</div>
after hugo processes it, test.html
`
data-srcset="/test_hub81943aaa5ac1460751b63b726285425_17287_222x0_resize_q75_h2_box.webp
222w" type="image/webp"
/> <source
data-srcset="/test_hub81943aaa5ac1460751b63b726285425_17287_222x0_resize_q75_box.jpg 222w"
type="image/jpeg"
/>
`
—
Reply to this email directly, view it on GitHub
<#70>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTWGAYWBNS4ORLUENHDR6TZWAVEJAVCNFSM6AAAAABOAZEVPCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUYTSNJTGE4DIMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I would rather not do extra processing for each call and just remove indentation by default from the output though. I'm looking through your code and testing out doing that instead. This is the wrapper code I'm using at the moment to get things going in the meantime. for partial
for shortcode
|
I tested out removing any leading spaces in opening html tags, it seems to be working well. picture-set.html image-tag.html noscript-tag.html figure-top.html figure-bottom.html |
The default output creates indents which is normally not a problem, but if you nest it inside a shortcode that allows markdown content, hugo breaks the image into code blocks due to indentation. I ended up making a wrapper shortcode to trim the spacing from the output as a workaround, but can we get an option to have this built in?
test.md
shortcodes/div.html
<div>{{- .Inner | safeHTML | markdownify -}}</div>
after hugo processes it, test.html
The text was updated successfully, but these errors were encountered: