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

Faulty conversion of html #369

Closed
mrprofessor opened this issue Jun 3, 2020 · 3 comments
Closed

Faulty conversion of html #369

mrprofessor opened this issue Jun 3, 2020 · 3 comments

Comments

@mrprofessor
Copy link
Contributor

mrprofessor commented Jun 3, 2020

Actual Behavior

ox-hugo converts

Here is the full source code running on Glitch.

#+BEGIN_HTML
  <div class="glitch-embed-wrap" style="height: 420px; width: 100%;">
    <iframe
      src="https://glitch.com/embed/#!/embed/silken-football?path=app.py&previewSize=0&sidebarCollapsed=true"
      title="silken-football on Glitch"
      style="height: 100%; width: 100%; border: 0;">
    </iframe>
  </div>
#+END_HTML

Feel free to remix and play around. Adios!

to

Here is the full source code running on Glitch.

<div class="HTML">
  <div></div>

<div class="glitch-embed-wrap" style="height: 420px; width: 100%;">
  <iframe
    src="<https://glitch.com/embed/#!/embed/silken-football?path=app.py&previewSize=0&sidebarCollapsed=true>"
    title="silken-football on Glitch"
    style="height: 100%; width: 100%; border: 0;">
  </iframe>
</div>

</div>

Feel free to remix and play around. Adios!

Notice the enclosing < > in the source string.

Expected Behavior

It should be

 <iframe
    src="https://glitch.com/embed/#!/embed/silken-football?path=app.py&previewSize=0&sidebarCollapsed=true"
    title="silken-football on Glitch"
    style="height: 100%; width: 100%; border: 0;">
  </iframe>

How to Reproduce the Issue

Example Org File

Generated Markdown File or Error

Ox-Hugo Debug Information

Debug Info
@mrprofessor mrprofessor changed the title Bad conversion of html Faulty conversion of html Jun 3, 2020
@kaushalmodi
Copy link
Owner

kaushalmodi commented Jun 3, 2020

Hello,

Use of #+begin_html .. #+end_html has been deprecated in Org mode for some time now (since Org 9.0. See https://orgmode.org/Changes_old.html, search for "New syntax for export blocks". If you scroll further down in there, you will find a helper function org-repair-export-blocks that you can use to fix your existing Org files.).

Use #+begin_export html .. #+end_export.

https://orgmode.org/guide/HTML-Export.html

@kaushalmodi
Copy link
Owner

@mrprofessor I have update a test with your example snippet: https://ox-hugo.scripter.co/test/posts/export_block_html/. I prevent external iframes and scripts from running on the ox-hugo test site (I have a pretty strict CSP), so you will not see that iframe. But you will see that that iframe HTML is exported as expected in https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/test/site/content/posts/export_block_html.md.

@mrprofessor
Copy link
Contributor Author

Thank you. I was migrating my old markdown files to org files using pandoc. It generated #+begin_html .. #+end_html instead of #+begin_export html .. #+end_export..

Thank you. Closing the issue.

faximilie added a commit to faximilie/blog that referenced this issue Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants