Skip to content

Commit 71901ec

Browse files
Next (#22)
* Fixed snyk issues and added auto publish package support in github action. (#18) * Fixed snyk issues and added auto publish package support in github ac… (#20) * Fixed snyk issues and added auto publish package support in github action. * Added security file and updated license * Updated changelog file message * Updated python version in github action file * Updated pip and pylint * Feat/cs 44004 json rte nested list fragment (#21) * Fixed snyk issues and added auto publish package support in github ac… (#19) * Fixed snyk issues and added auto publish package support in github action. (#18) * Fixed snyk issues and added auto publish package support in github ac… (#20) * Fixed snyk issues and added auto publish package support in github action. * Added security file and updated license * Updated changelog file message * Updated python version in github action file * Updated pip and pylint * Added fragment style attribute in JSON RTE nested list Updated License file. * Fix/cs 44004 changed host name (#23) * Added fragment style attribute in JSON RTE nested list Updated License file. * Changed dev url to prod url
1 parent 4545e10 commit 71901ec

File tree

10 files changed

+151
-37
lines changed

10 files changed

+151
-37
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2023 Contentstack
1+
Copyright 2024 Contentstack
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
================
22
**CHANGELOG**
33
================
4+
*v1.2.3*
5+
============
6+
7+
NEW FEATURE: Added Fragment attribute.
8+
9+
- added new style attribute fragment
410

511
*v1.2.2*
612
============

contentstack_utils/render/options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def render_node(node_type, node_obj: dict, callback):
113113
return "<blockquote>" + inner_html + "</blockquote>"
114114
if node_type == 'code':
115115
return "<code>" + inner_html + "</code>"
116+
if node_type == 'fragment':
117+
return "<fragment>" + inner_html + "</fragment>"
116118
if node_type in ['doc', 'reference']:
117119
return inner_html
118120
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
long_description_content_type="text/markdown",
1616
url="https://github.com/contentstack/contentstack-utils-python",
1717
license='MIT',
18-
version='1.2.2',
18+
version='1.2.3',
1919
install_requires=[
2020

2121
],

tests/mocks/multiple_rich_text_content.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"file_size": "11773",
1818
"_content_type_uid": "asset",
1919
"filename": "11.jpg",
20-
"url": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
20+
"url": "https://app.contentstack.com/v3/assets/11.jpg",
2121
"_version": 2,
2222
"title": "11.jpg",
2323
"description": "dddd",
@@ -40,7 +40,7 @@
4040
"file_size": "11773",
4141
"_content_type_uid": "0_solve",
4242
"filename": "11.jpg",
43-
"url": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
43+
"url": "https://app.contentstack.com/v3/assets/11.jpg",
4444
"_version": 2,
4545
"title": "11.jpg",
4646
"description": "dddd",
@@ -63,7 +63,7 @@
6363
"file_size": "11773",
6464
"_content_type_uid": "0_solve",
6565
"filename": "11.jpg",
66-
"url": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
66+
"url": "https://app.contentstack.com/v3/assets/11.jpg",
6767
"_version": 2,
6868
"title": "11.jpg",
6969
"description": "dddd",
@@ -86,7 +86,7 @@
8686
"file_size": "11773",
8787
"_content_type_uid": "0_solve",
8888
"filename": "11.jpg",
89-
"url": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
89+
"url": "https://app.contentstack.com/v3/assets/11.jpg",
9090
"_version": 2,
9191
"title": "11.jpg",
9292
"description": "dddd",
@@ -104,7 +104,7 @@
104104
"url": "/suraj-123-entry",
105105
"single_line": "Single line textbox",
106106
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
107-
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://stag-assets.contentstack.io/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
107+
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://app.contentstack.com/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
108108
"markdown": "fsdfsdfsdfasf",
109109
"modular_blocks": [
110110
{
@@ -163,7 +163,7 @@
163163
"file_size": "59014",
164164
"_content_type_uid": "0_solve",
165165
"filename": "iphone-mockup.png",
166-
"url": "https://dev16-images.contentstack.com/v3/assets/iphone-mockup.png",
166+
"url": "https://app.contentstack.com/v3/assets/iphone-mockup.png",
167167
"ACL": {},
168168
"_version": 1,
169169
"title": "iphone-mockup.png",
@@ -186,7 +186,7 @@
186186
"file_size": "11773",
187187
"_content_type_uid": "0_solve",
188188
"filename": "11.jpg",
189-
"url": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
189+
"url": "https://app.contentstack.com/v3/assets/11.jpg",
190190
"_version": 2,
191191
"title": "11.jpg",
192192
"description": "dddd",
@@ -204,7 +204,7 @@
204204
"url": "/suraj-123-entry",
205205
"single_line": "Single line textbox",
206206
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
207-
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://stag-assets.contentstack.io/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"removed_for_security_reasons\" alt=\"Ticket.pdf\">",
207+
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://app.contentstack.com/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"removed_for_security_reasons\" alt=\"Ticket.pdf\">",
208208
"markdown": "fsdfsdfsdfasf",
209209
"modular_blocks": [
210210
{
@@ -308,12 +308,12 @@
308308
}
309309
],
310310
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
311-
"rich_text_editor": "<img data-image=\"199k9jsr64s5\" src=\"https://stag-images.contentstack.io/v3/assets/220px-Bastet_Istanbul_museum.JPG\" data-sys-asset-uid=\"c9d4efe393ee4c5a\" alt=\"220px-Bastet_Istanbul_museum.JPG\">",
311+
"rich_text_editor": "<img data-image=\"199k9jsr64s5\" src=\"https://app.contentstack.com/v3/assets/220px-Bastet_Istanbul_museum.JPG\" data-sys-asset-uid=\"c9d4efe393ee4c5a\" alt=\"220px-Bastet_Istanbul_museum.JPG\">",
312312
"single_line": "Single line textbox",
313313
"suraj_123": [
314314
{
315315
"single_line": "Multi line textbox",
316-
"rich_text_editor": "<img data-image=\"mzeant040dnw\" src=\"https://stag-images.contentstack.io/v3/assets/220px-House_sparrow04.jpg\" data-sys-asset-uid=\"863ce52b0c65d670\" alt=\"220px-House_sparrow04.jpg\">",
316+
"rich_text_editor": "<img data-image=\"mzeant040dnw\" src=\"https://app.contentstack.com/v3/assets/220px-House_sparrow04.jpg\" data-sys-asset-uid=\"863ce52b0c65d670\" alt=\"220px-House_sparrow04.jpg\">",
317317
"markdown": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
318318
"number": 45346346
319319
}
@@ -413,7 +413,7 @@
413413
"url": "/suraj-123-entry",
414414
"single_line": "Single line textbox",
415415
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
416-
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://stag-assets.contentstack.io/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
416+
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://app.contentstack.com/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
417417
"markdown": "fsdfsdfsdfasf",
418418
"modular_blocks": [
419419
{
@@ -517,7 +517,7 @@
517517
}
518518
],
519519
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
520-
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://stag-assets.contentstack.io/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
520+
"rich_text_editor": "<img data-image=\"lbeuy3biyi6r\" src=\"https://app.contentstack.com/v3/assets/Ticket.pdf\" data-sys-asset-uid=\"9bfd9e8d4df0ad1e\" alt=\"Ticket.pdf\">",
521521
"single_line": "Single line textbox",
522522
"suraj_123": [
523523
{
@@ -642,12 +642,12 @@
642642
}
643643
],
644644
"multi_line": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
645-
"rich_text_editor": "<img data-image=\"199k9jsr64s5\" src=\"https://stag-images.contentstack.io/v3/assets/220px-Bastet_Istanbul_museum.JPG\" data-sys-asset-uid=\"c9d4efe393ee4c5a\" alt=\"220px-Bastet_Istanbul_museum.JPG\">",
645+
"rich_text_editor": "<img data-image=\"199k9jsr64s5\" src=\"https://app.contentstack.com/v3/assets/220px-Bastet_Istanbul_museum.JPG\" data-sys-asset-uid=\"c9d4efe393ee4c5a\" alt=\"220px-Bastet_Istanbul_museum.JPG\">",
646646
"single_line": "Single line textbox",
647647
"suraj_123": [
648648
{
649649
"single_line": "Multi line textbox",
650-
"rich_text_editor": "<img data-image=\"mzeant040dnw\" src=\"https://stag-images.contentstack.io/v3/assets/220px-House_sparrow04.jpg\" data-sys-asset-uid=\"863ce52b0c65d670\" alt=\"220px-House_sparrow04.jpg\">",
650+
"rich_text_editor": "<img data-image=\"mzeant040dnw\" src=\"https://app.contentstack.com/v3/assets/220px-House_sparrow04.jpg\" data-sys-asset-uid=\"863ce52b0c65d670\" alt=\"220px-House_sparrow04.jpg\">",
651651
"markdown": "Multi line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textboxMulti line textbox",
652652
"number": 45346346
653653
}
@@ -690,7 +690,7 @@
690690
"modular_blocks": [
691691
{
692692
"rich_in_modular": {
693-
"rich_text_editor": "<p>global&nbsp;</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>\n<p> modular 1</p>",
693+
"rich_text_editor": "<p>global&nbsp;</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>\n<p> modular 1</p>",
694694
"rich_text_editor_multiple": [
695695
"<p>global modular 2<span class=\"redactor-component embedded-entry inline-entry\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-entry-uid=\"2fcbb159a2a4c216\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"0_bug_1\" data-sys-can-edit=\"true\" sys-style-type=\"inline\" type=\"entry\"></span></p>"
696696
],
@@ -708,17 +708,17 @@
708708
"<p>Global multiple 2<span class=\"redactor-component embedded-entry inline-entry\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-entry-uid=\"49af3673cdd268a5\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"0_solve\" data-sys-can-edit=\"true\" sys-style-type=\"inline\" type=\"entry\"></span></p>"
709709
],
710710
"group": {
711-
"rich_text_editor": "<p>Global multiple group 1</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>",
711+
"rich_text_editor": "<p>Global multiple group 1</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>",
712712
"rich_text_editor_multiple": [
713-
"<p>Global multiple group 2</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>"
713+
"<p>Global multiple group 2</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>"
714714
]
715715
},
716716
"modular_blocks": [
717717
{
718718
"rich_in_modular": {
719719
"rich_text_editor": "<p><a data-sys-entry-uid=\"1c9e75e3608f8c6b\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"0_solve\" sys-style-type=\"link\" data-sys-can-edit=\"true\" class=\"embedded-entry\" type=\"entry\" href=\"/untitled\" title=\"Entry 001 123\">Global multiple modular 1</a></p>",
720720
"rich_text_editor_multiple": [
721-
"<p>Global multiple modular</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>\n<p> 2</p>"
721+
"<p>Global multiple modular</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>\n<p> 2</p>"
722722
],
723723
"_metadata": {
724724
"uid": "6d492f34be84aa04"
@@ -742,7 +742,7 @@
742742
"rich_text_inmodular": {
743743
"rich_text_editor": "<div class=\"redactor-component embedded-entry block-entry redactor-component-active\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-entry-uid=\"f2fb45e5fc46f8d4\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"00_suraj_final\" data-sys-can-edit=\"true\" sys-style-type=\"block\" type=\"entry\"></div>\n<p>Modul 1</p>",
744744
"rich_text_editor_multiple": [
745-
"<p>module 2&nbsp;</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>"
745+
"<p>module 2&nbsp;</p><figure class=\"embedded-asset\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" data-sys-asset-filename=\"11.jpg\" data-sys-asset-contenttype=\"image/jpeg\" type=\"asset\" sys-style-type=\"display\"></figure>"
746746
],
747747
"_metadata": {
748748
"uid": "b005424df53ebe6d"
@@ -786,9 +786,9 @@
786786
"_content_type_uid": "embed_entry"
787787
}
788788
],
789-
"rich_text_editor": "<div class=\"redactor-component embedded-entry block-entry\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-entry-uid=\"41a3bf40728446c3\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"00_suraj\" sys-style-type=\"block\" type=\"entry\" data-sys-can-edit=\"true\"></div>\n<p>one</p>\n<figure class=\"embedded-asset\" data-sys-asset-filelink=\"https://dev16-images.contentstack.com/v3/assets/iphone-mockup.png\" data-sys-asset-uid=\"120a5a04d91c9466\" data-sys-asset-filename=\"iphone-mockup.png\" data-sys-asset-contenttype=\"image/png\" type=\"asset\" sys-style-type=\"display\"></figure>",
789+
"rich_text_editor": "<div class=\"redactor-component embedded-entry block-entry\" data-redactor-type=\"embed\" data-widget-code=\"\" data-sys-entry-uid=\"41a3bf40728446c3\" data-sys-entry-locale=\"en-us\" data-sys-content-type-uid=\"00_suraj\" sys-style-type=\"block\" type=\"entry\" data-sys-can-edit=\"true\"></div>\n<p>one</p>\n<figure class=\"embedded-asset\" data-sys-asset-filelink=\"https://app.contentstack.com/v3/assets/iphone-mockup.png\" data-sys-asset-uid=\"120a5a04d91c9466\" data-sys-asset-filename=\"iphone-mockup.png\" data-sys-asset-contenttype=\"image/png\" type=\"asset\" sys-style-type=\"display\"></figure>",
790790
"rich_text_editor_multiple": [
791-
"<p>Two</p><img data-image=\"akofs65z4070\" src=\"https://dev16-images.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" alt=\"11.jpg\">"
791+
"<p>Two</p><img data-image=\"akofs65z4070\" src=\"https://app.contentstack.com/v3/assets/11.jpg\" data-sys-asset-uid=\"7324a68403ee7281\" alt=\"11.jpg\">"
792792
],
793793
"title": "Test Rich Text",
794794
"updated_at": "2020-11-05T08:26:14.590Z",

tests/mocks/supercharged/results/Results.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
blockquoteHtml = "<blockquote>Praesent eu ex sed nibh venenatis pretium.</blockquote>"
3131
codeHtml = "<code>Code template.</code>"
3232
linkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href=\"LINK.com\">LINK</a></p>"
33+
nested_order_list_with_fragment = "<ol><li><fragment>List Item 1</fragment><ol><li>List Item 1.1</li><li>List Item 1.2</li><li>List Item 1.3</li></ol></li></ol>"
34+
nested_unorder_list_with_fragment = "<ul><li><fragment>List Item 1</fragment><ul><li>List Item 1.1</li><li>List Item 1.2</li><li>List Item 1.3</li></ul></li></ul>"

tests/mocks/supercharged/srte.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418
"uid": "deleted_for_security_reasons",
419419
"type": "img",
420420
"attrs": {
421-
"url": "https://dev16-images.contentstack.com/v3/assets/Donald.jog.png",
421+
"url": "https://app.contentstack.com/v3/assets/Donald.jog.png",
422422
"width": 33.69418132611637,
423423
"height": "auto",
424424
"redactor-attributes": {
@@ -610,7 +610,7 @@
610610
"display-type": "asset",
611611
"asset-uid": "assetuiddemo",
612612
"content-type-uid": "sys_assets",
613-
"asset-link": "https://dev16-images.contentstack.com/v3/assets/11.jpg",
613+
"asset-link": "https://app.contentstack.com/v3/assets/11.jpg",
614614
"asset-name": "11.jpg",
615615
"asset-type": "image/jpeg",
616616
"type": "asset",

0 commit comments

Comments
 (0)