-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faf62f3
commit 9bff6ef
Showing
27 changed files
with
75 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div data-show-gap="true" data-type="imageStrip"><figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F200%2F301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure><figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F200%2F301" alt="Happy Kitten" width="300" height="400"/></picture><figcaption>New Kitty</figcaption></figure></div> | ||
<div data-show-gap="true" data-type="imageStrip"><figure><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/200/301" type="image"/><img src="https://placekitten.com/200/301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure><figure><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/200/301" type="image"/><img src="https://placekitten.com/200/301" alt="Happy Kitten" width="300" height="400"/></picture><figcaption>New Kitty</figcaption></figure></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure class="featured-image"><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F200%2F301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure> | ||
<figure class="featured-image"><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/200/301" type="image"/><img src="https://placekitten.com/200/301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure class="featured-image"><picture><source srcset="https%3A%2F%2Fwww.python.org%2Fpython-logo.webp" type="image/webp"/><source srcset="https%3A%2F%2Fwww.python.org%2Fpython-logo.png" type="image/png"/><img src="https%3A%2F%2Fwww.python.org%2Fpython-logo.png" alt="python"/></picture></figure> | ||
<figure class="featured-image"><picture><source srcset="https://www.python.org/python-logo.webp" type="image/webp"/><source srcset="https://www.python.org/python-logo.png" type="image/png"/><img src="https://www.python.org/python-logo.png" alt="python"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure class="featured-image"><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Brown Kitten Image"/></picture></figure> | ||
<figure class="featured-image"><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Brown Kitten Image"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure class="featured-image"><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Brown Kitten Image"/></picture></figure> | ||
<figure class="featured-image"><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Brown Kitten Image"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure class="featured-image"><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Brown Kitten Image"/></picture><figcaption>Cute Kitty</figcaption></figure> | ||
<figure class="featured-image"><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Brown Kitten Image"/></picture><figcaption>Cute Kitty</figcaption></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F200%2F301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure> | ||
<figure><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/200/301" type="image"/><img src="https://placekitten.com/200/301" alt="Sleepy Kitten" width="300" height="400"/></picture><figcaption>Cute Kitty</figcaption></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure><picture><source srcset="https%3A%2F%2Fwww.python.org%2Fpython-logo.webp" type="image/webp"/><source srcset="https%3A%2F%2Fwww.python.org%2Fpython-logo.png" type="image/png"/><img src="https%3A%2F%2Fwww.python.org%2Fpython-logo.png" alt="python"/></picture></figure> | ||
<figure><picture><source srcset="https://www.python.org/python-logo.webp" type="image/webp"/><source srcset="https://www.python.org/python-logo.png" type="image/png"/><img src="https://www.python.org/python-logo.png" alt="python"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Sleepy Kitten"/></picture></figure> | ||
<figure><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Sleepy Kitten"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Sleepy Kitten"/></picture></figure> | ||
<figure><picture><source srcset="https://placekitten.com/200/301" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Sleepy Kitten"/></picture></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<figure><picture><source srcset="https%3A%2F%2Fplacekitten.com%2F200%2F301" type="image"/><source srcset="https%3A%2F%2Fplacekitten.com%2F198%2F654" type="image"/><img src="https%3A%2F%2Fplacekitten.com%2F198%2F654" alt="Sleepy Kitten"/></picture><figcaption><script>alert(23)</script>Cute Kitty</figcaption></figure> | ||
<figure><picture><source srcset="https://placekitten.com/200/301?text="escape me"" type="image"/><source srcset="https://placekitten.com/198/654" type="image"/><img src="https://placekitten.com/198/654" alt="Sleepy Kitten"/></picture><figcaption><script>alert(23)</script>Cute Kitty</figcaption></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<p>This is <strong>bold text</strong>, this is <em>italic text</em>, this is <strong><em><script>alert('hello');</script> italic and bold text</em></strong> and this has a <a title="foo.bar" href="https%3A%2F%2Ffoobar.withgoogle.com%2F" target="_blank" rel="noopener nofollow">link</a></p> | ||
<p>This is <strong>bold text</strong>, this is <em>italic text</em>, this is <strong><em><script>alert('hello');</script> italic and bold text</em></strong> and this has a <a href="https://foobar.withgoogle.com/" title="foo.bar" target="_blank" rel="noopener nofollow">link</a></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
# Image file type and it's MIME type mappings that are suported by tiptapy. | ||
# Detailed documentation can be found about Image file type and format guide. | ||
# Link: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types | ||
from html import escape | ||
from os.path import splitext | ||
|
||
class SupportedFormatsMapper(dict): | ||
|
||
class SupportedFormatsMapper(dict): | ||
def __missing__(self, ext): | ||
return 'image' | ||
return "image" | ||
|
||
|
||
SUPPORTED_FORMATS_MAP = SupportedFormatsMapper( | ||
PNG='image/png', | ||
JPG='image/jpeg', | ||
JPEG='image/jpeg', | ||
GIF='image/gif', | ||
BMP='image/bmp', | ||
WEBP='image/webp', | ||
SVG='image/svg+xml' | ||
PNG="image/png", | ||
JPG="image/jpeg", | ||
JPEG="image/jpeg", | ||
GIF="image/gif", | ||
BMP="image/bmp", | ||
WEBP="image/webp", | ||
SVG="image/svg+xml", | ||
) | ||
|
||
|
||
def url2mime(url): | ||
ext = splitext(url)[-1] | ||
ext = (ext[1:] if ext.startswith('.') else ext).upper() | ||
return SUPPORTED_FORMATS_MAP[ext] | ||
ext = (ext[1:] if ext.startswith(".") else ext).upper() | ||
return escape(SUPPORTED_FORMATS_MAP[ext]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{%- if node.attrs.src -%} | ||
{%- set caption = node.attrs.caption|trim -%} | ||
{%- set caption = node.attrs.caption|trim|escape -%} | ||
{%- set audio_player_block = get_audio_player_block() -%} | ||
{%- set src = node.attrs.src|trim|escape -%} | ||
|
||
<figure class="audio-player-container"> | ||
{%- if caption -%} | ||
<div><audio src={{node.attrs.src|trim|quote_plus}}></audio>{{audio_player_block}}</div><figcaption>{{escape(caption)}}</figcaption> | ||
<div><audio src={{src}}></audio>{{audio_player_block}}</div><figcaption>{{caption}}</figcaption> | ||
{%- else -%} | ||
<div><audio src={{node.attrs.src|trim|quote_plus}}></audio>{{audio_player_block}}</div> | ||
<div><audio src={{src}}></audio>{{audio_player_block}}</div> | ||
{%- endif -%} | ||
</figure> | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters