Skip to content

Commit

Permalink
Add test for iframe src within an HTML export block
Browse files Browse the repository at this point in the history
Ref: #369
  • Loading branch information
kaushalmodi committed Jun 3, 2020
1 parent 94aec3f commit f8e26aa
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/site/content-org/all-posts.org
Original file line number Diff line number Diff line change
Expand Up @@ -5816,7 +5816,39 @@ will need to remain unescaped:
</script>
</div>
#+end_export
**** ~#+begin_export html~ blocks with script tag
{{{oxhugoissue(369)}}}

Check that ~src="https://example.com"~ does not become
~src="<https://example.com>"~.

- Note :: Below iframe/script will *not* work on this site because of
the strict [[https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP][CSP]]. Anyways. this site is to test just the
Markdown exported by ox-hugo. So please see "/✱ Markdown
source of this page/" above.

#+begin_src org
,#+begin_export 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_export
#+end_src

#+begin_export 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_export
**** To see the exported HTML
/See the Markdown source of this page to see the verbatim-inserted
HTML./
* Miscellaneous Front Matter :front_matter:
Expand Down
39 changes: 39 additions & 0 deletions test/site/content/posts/export_block_html.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,44 @@ will need to remain unescaped:
</script>
</div>


## `#+begin_export html` blocks with script tag {#plus-begin-export-html-blocks-with-script-tag}

`ox-hugo` Issue #[369](https://github.com/kaushalmodi/ox-hugo/issues/369)

Check that `src="https://example.com"` does not become
`src="<https://example.com>"`.

Note
: Below iframe/script will **not** work on this site because of
the strict [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). Anyways. this site is to test just the
Markdown exported by ox-hugo. So please see "_✱ Markdown
source of this page_" above.

<!--listend-->

```org
#+begin_export 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_export
```

<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>


## To see the exported HTML {#to-see-the-exported-html}

_See the Markdown source of this page to see the verbatim-inserted
HTML._

0 comments on commit f8e26aa

Please sign in to comment.