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

HTML not interpreted with CLI #57

Closed
cansik opened this issue Jan 5, 2019 · 6 comments
Closed

HTML not interpreted with CLI #57

cansik opened this issue Jan 5, 2019 · 6 comments
Labels
question 🙅 Not issue, just a question (should post to Marp discussion)

Comments

@cansik
Copy link

cansik commented Jan 5, 2019

I use HTML tags in my presentation to include an image and show it on the right side. Everything works fine while using the marp editor, but when I would like to build it with the CLI version, the HTML tags are not evaluated. Not in server or preview mode and not with allow-local-files and not with pdf or html output.

The pdf gets render correctly only when using the Export to pdf method in the marp editor itself.

Would be great if you could give me a hint. Here are some screenshots of the problem:

image
Marp editor with html tag

marp --pdf --allow-local-files Abstrakteklassen.md

Marp CLI build command

image
Rendered PDF

@yhatt yhatt added the question 🙅 Not issue, just a question (should post to Marp discussion) label Jan 6, 2019
@yhatt
Copy link
Member

yhatt commented Jan 6, 2019

Try --html option.

marp --html --pdf --allow-local-files Abstrakteklassen.md

Marp CLI would escape not-whitelisted HTML by default because of several security reason. Refer to: CVE-2017-2239, marp-team/marp-core#9, marp-team/marp-core#26, yhatt/marp#259

@cansik
Copy link
Author

cansik commented Jan 6, 2019

Ok nice, that worked...but the rendered output is not the same as with Marp. The align="right" is not interpreted.

## Abstrakte Klassen - Store

<img src="diagrams/store_oop.svg" width="600" align="right">

- Alle Klassen können **instanziert** werden
- Die Kindklassen **müssen** keine Funktion überschreiben

Article a1 = new Article(23, "Test1");
Article a2 = new Book(12, "Test2");

Gets rendered like this:

image

@yhatt
Copy link
Member

yhatt commented Jan 7, 2019

In the complete re-written tools released by marp-team, included Marp CLI, you should not expect the exactly same result with yhatt/marp. In this case, yhatt/marp's older Chromium has wrong rendering.

According to W3C, the floating element in flexbox is ignored. Marp slide has consisted of flex container, and the floating by align=right should be ignored.

ref: https://stackoverflow.com/a/39194800

Instead of align=right, you can use split background by ![bg right](bg.jpg)

![bg right w:600](diagrams/store_oop.svg)

@cansik
Copy link
Author

cansik commented Jan 7, 2019

Ok, I got it now...I was a bit confused with the difference between marp-cli, marpit, marpcore, marp, and yhatt/marp.

Just that I am not missing something: There is currently no marp editor for the new version, which works like yhatt/marp?

@yhatt
Copy link
Member

yhatt commented Jan 7, 2019

You are right: Currently marp-team have not provide an editor. I have not the time to develop a editor because currently I focus to the minimum viable product, that is the conversion from Markdown to slide deck.

At the moment, the most similar usage is the combination with Marp CLI's preview mode (marp -p) and your favorite editor, Vim, Emacs, Atom, VSCode, etc...

In future, marp-team/marp-web (In development: https://web.marp.app/) would become a new editor. Sometime I'm going to create blog and explain about the whole of our project clearly. (marp-team/marp#11) Please excuse my lack of explanation!

@cansik
Copy link
Author

cansik commented Jan 7, 2019

Thanks for the clarification (: and great piece of software! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 🙅 Not issue, just a question (should post to Marp discussion)
Projects
None yet
Development

No branches or pull requests

2 participants