Skip to content
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

Remove unnecessary backslash #1979

Closed
wants to merge 1 commit into from
Closed

Conversation

TheDauntless
Copy link
Collaborator

Very tiny fix

Copy link
Collaborator

@sushi2k sushi2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using this throughout the guide it seems (with the backslash at the end) for images. Unfortunately I cannot recall why. Usually this would be a line break. Let's keep it for now and raise a ticket, as this might be some workaround for the document build pipeline

@cpholguera
Copy link
Collaborator

@sushi2k I found the commit where those backslashes where added: https://github.com/OWASP/owasp-mstg/blob/707b1f7b2a0f516ab76be3607c355daf85b647a3/Document/0x02-Frontispiece.md

"fixed issue with captions in epub and docx"

Do you recall what was happening without them?

@cpholguera
Copy link
Collaborator

I assume this is why:

https://pandoc.org/MANUAL.html#images

See "Extension: implicit_figures"

If you just want a regular inline image, just make sure it is not the only thing in the paragraph. One way to do this is to insert a nonbreaking space after the image:

![This image won't be a figure](/url/of/image.png)\

We still have the issue that the images do not have a width so they're being shown at maximum size. Maybe we can include imgs as HTML:

<img href="file.jpg" style="width: 50%;" alt="some caption"/>

and, right before giving it to pandocker, we have a short script converting those to:

![some caption](file.jpg){ width=50% }

Having HTML imgs in the original document means that markdown renderers will render them properly including width. And then pandocker will take care of converting the markdown to whatever other format because we use the official supported syntax from pandoc markdown extension.

@cpholguera
Copy link
Collaborator

@TheDauntless see my last comment, I've introduced that in #2059

tools/docker/pandoc_makedocs.sh will run tools/docker/imagereplace.sed so we can input HTML imgs now.

So maybe this PR should remove all those backslashes and convert the images to HTML including a width. For this we have to review the PDF, since some images will be ok but others are for instance extremely big.

@TheDauntless
Copy link
Collaborator Author

As this one was pretty outdated, I continued in a new branch, so closing this one.

See #2126 for follow up.

@TheDauntless TheDauntless deleted the TheDauntless-patch-1 branch June 27, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants