Skip to content

Commit

Permalink
attrs added for blockquote and ol as wwell
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Singla committed Jun 11, 2024
1 parent fc6573c commit 3a952e6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/data/html/blockquote.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<blockquote><p>This is a blockquote</p></blockquote>
<blockquote id="b-NzgT2MAhuSTnpFyo-E3"><p>This is a blockquote</p></blockquote>
2 changes: 1 addition & 1 deletion tests/data/html/ordered_list.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1>Scroll</h1><ol start="1"><li><p>One</p></li><li><p>Two</p></li><li><p>Three</p></li></ol><ol start="2"><li><p>One</p></li><li><p>Two</p></li><li><p>Three</p></li></ol>
<h1>Scroll</h1><ol start="1" id="b-NzgT2MAhuSTnpFyo-E3"><li><p>One</p></li><li><p>Two</p></li><li><p>Three</p></li></ol><ol start="2" id="b-NzgT2MAhuSTnpFyo-E3"><li><p id="b-NzgT2MAhuSTnpFyo-E3">One</p></li><li><p>Two</p></li><li><p>Three</p></li></ol>
3 changes: 3 additions & 0 deletions tests/data/json/blockquote.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"content": [
{
"type": "blockquote",
"attrs": {
"id": "b-NzgT2MAhuSTnpFyo-E3"
},
"content": [
{
"type": "paragraph",
Expand Down
9 changes: 7 additions & 2 deletions tests/data/json/ordered_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{
"type": "ordered_list",
"attrs": {
"order": 1
"order": 1,
"id": "b-NzgT2MAhuSTnpFyo-E3"
},
"content": [
{
Expand Down Expand Up @@ -63,14 +64,18 @@
{
"type": "ordered_list",
"attrs": {
"start": 2
"start": 2,
"id": "b-NzgT2MAhuSTnpFyo-E3"
},
"content": [
{
"type": "list_item",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "b-NzgT2MAhuSTnpFyo-E3"
},
"content": [
{
"type": "text",
Expand Down
2 changes: 1 addition & 1 deletion tiptapy/templates/blockquote.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<blockquote>
<blockquote{{ extract_tag_attrs(node) }}>
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
{%- include template -%}
Expand Down
4 changes: 2 additions & 2 deletions tiptapy/templates/orderedList.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- if node.attrs.start -%}
<ol start="{{ node.attrs.start }}">
<ol start="{{ node.attrs.start }}"{{ extract_tag_attrs(node) }}>
{%- else -%}
<ol start="{{ node.attrs.order|default(1) }}">
<ol start="{{ node.attrs.order|default(1) }}"{{ extract_tag_attrs(node) }}>
{%- endif -%}
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
Expand Down
4 changes: 2 additions & 2 deletions tiptapy/templates/ordered_list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- if node.attrs.start -%}
<ol start="{{ node.attrs.start }}">
<ol start="{{ node.attrs.start }}"{{ extract_tag_attrs(node) }}>
{%- else -%}
<ol start="{{ node.attrs.order|default(1) }}">
<ol start="{{ node.attrs.order|default(1) }}"{{ extract_tag_attrs(node) }}>
{%- endif -%}
{%- for item in node.content -%}
{%- with template=item.type + '.html', node=item -%}
Expand Down

0 comments on commit 3a952e6

Please sign in to comment.