Skip to content

Commit

Permalink
name change
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Singla committed Jun 6, 2024
1 parent 14f55d9 commit fc6573c
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tiptapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
get_audio_player_block,
get_doc_block,
make_img_src,
extract_parent_tag_attrs,
extract_tag_attrs,
)

__version__ = "0.19.0"
Expand All @@ -27,7 +27,7 @@ def init_env(path, config):
)
# https://stackoverflow.com/a/6038550
env.globals["url2mime"] = url2mime
env.globals["extract_parent_tag_attrs"] = extract_parent_tag_attrs
env.globals["extract_tag_attrs"] = extract_tag_attrs
env.globals["make_img_src"] = make_img_src
env.globals["handle_links"] = build_link_handler(config)
env.globals["get_audio_player_block"] = get_audio_player_block
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from urllib.parse import urlparse


def extract_parent_tag_attrs(node):
def extract_tag_attrs(node):
allowed_attributes = ("id",)
attrs = node.get("attrs")
return (
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/codeBlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{%- if node.content -%}
{%- set text = node.content[0].text -%}
{%- if text -%}
<div{{ extract_parent_tag_attrs(node) }}><pre>
<div{{ extract_tag_attrs(node) }}><pre>
{%- if language -%}
<code data-lang="{{language}}">{{text}}</code>
{%- else -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/code_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{%- if node.content -%}
{%- set text = node.content[0].text -%}
{%- if text -%}
<div{{ extract_parent_tag_attrs(node) }}><pre>
<div{{ extract_tag_attrs(node) }}><pre>
{%- if language -%}
<code data-lang="{{language}}">{{text}}</code>
{%- else -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/embed.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- set html = node.attrs.html -%}

{%- set provider_name = node.attrs.provider|default('link')|lower -%}
<div class="embed-wrapper {{provider_name}}-wrapper"{{ extract_parent_tag_attrs(node) }}>
<div class="embed-wrapper {{provider_name}}-wrapper"{{ extract_tag_attrs(node) }}>
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
{%- include template -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/extras/audio.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- set audio_player_block = get_audio_player_block() -%}
{%- set src = node.attrs.src|trim -%}

<figure class="audio-player-container"{{ extract_parent_tag_attrs(node) }}>
<figure class="audio-player-container"{{ extract_tag_attrs(node) }}>
{%- if caption -%}
<div><audio src={{src}}></audio>{{audio_player_block}}</div><figcaption>{{caption}}</figcaption>
{%- else -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/extras/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{%- set ext = node.attrs.format|trim -%}
{%- if src and size and fname and ext -%}
{%- set doc_block = get_doc_block(ext, fname, size, src) -%}
<figure class="file-attachment"{{ extract_parent_tag_attrs(node) }}>
<figure class="file-attachment"{{ extract_tag_attrs(node) }}>
{%- if caption -%}
{{doc_block}}<figcaption>{{caption}}</figcaption>
{%- else -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/heading.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h{{node.attrs.level|default(1)}}{{ extract_parent_tag_attrs(node) }}>
<h{{node.attrs.level|default(1)}}{{ extract_tag_attrs(node) }}>
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
{%- include template -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/horizontalRule.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<hr{{ extract_parent_tag_attrs(node) }}>
<hr{{ extract_tag_attrs(node) }}>
2 changes: 1 addition & 1 deletion tiptapy/templates/horizontal_rule.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<hr{{ extract_parent_tag_attrs(node) }}>
<hr{{ extract_tag_attrs(node) }}>
2 changes: 1 addition & 1 deletion tiptapy/templates/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{%- set fallback_type = url2mime(fallback_url) -%}

{%- if image_url or fallback_url -%}
<figure{{ extract_parent_tag_attrs(node) }}><picture><source srcset="{{ image_url }}" type="{{ image_type }}"/><source srcset="{{ fallback_url }}" type="{{ fallback_type }}"/><{{ make_img_src(node.attrs) }}/></picture>
<figure{{ extract_tag_attrs(node) }}><picture><source srcset="{{ image_url }}" type="{{ image_type }}"/><source srcset="{{ fallback_url }}" type="{{ fallback_type }}"/><{{ make_img_src(node.attrs) }}/></picture>
{%- if caption -%}
<figcaption>{{ caption }}</figcaption>
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/paragraph.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- if node.content -%}
<p{{ extract_parent_tag_attrs(node) }}>
<p{{ extract_tag_attrs(node) }}>
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
{%- include template -%}
Expand Down

0 comments on commit fc6573c

Please sign in to comment.