Skip to content

Commit 261f76c

Browse files
committed
Add unsafe_contents_md to text component, add related file tests, add documentation parameters
1 parent 2cfbe4b commit 261f76c

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'text', * FROM (VALUES
2+
('unsafe_contents_md','Markdown format with html blocks. Use this only with trusted content. See the html-blocks section of the Commonmark spec for additional info.', 'TEXT', TRUE, TRUE),
3+
('unsafe_contents_md','Markdown format with html blocks. Use this only with trusted content. See the html-blocks section of the Commonmark spec for additional info.', 'TEXT', FALSE, TRUE)
4+
);

sqlpage/templates/text.handlebars

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
{{~/if~}}
99
{{~#if contents_md~}}
1010
<div class="remove-bottom-margin {{#if center}}mx-auto{{/if}} {{#if article}}markdown article-text{{/if}}">
11-
{{{~markdown contents_md allow_unsafe~}}}
11+
{{{~markdown contents_md~}}}
12+
</div>
13+
{{~/if~}}
14+
{{~#if unsafe_contents_md~}}
15+
<div class="remove-bottom-margin {{#if center}}mx-auto{{/if}} {{#if article}}markdown article-text{{/if}}">
16+
{{{~markdown unsafe_contents_md 'allow_unsafe'~}}}
1217
</div>
1318
{{~/if~}}
1419
<p class="{{#if center}}mx-auto{{/if}} {{#if article}}markdown article-text{{/if}}">
@@ -30,7 +35,10 @@
3035
">{{contents}}</span>
3136
{{~flush_delayed~}}
3237
{{~#if contents_md~}}
33-
{{{markdown contents_md allow_unsafe}}}
38+
{{{markdown contents_md}}}
39+
{{~/if~}}
40+
{{~#if unsafe_contents_md~}}
41+
{{{markdown unsafe_contents_md 'allow_unsafe'}}}
3442
{{~/if~}}
3543
{{~/each_row~}}
3644
</p>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
select 'text' as component,
2+
'### It works !' AS contents_md;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
select 'text' as component,
2+
'<span>It works !</span>' AS unsafe_contents_md;

0 commit comments

Comments
 (0)