Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvjeantet <valere.jeantet@gmail.com>2020-09-25 10:03:49 +0300
committervjeantet <valere.jeantet@gmail.com>2020-09-25 10:03:49 +0300
commite4e112f9f561c428fa2d443aecbc82cacbbeae27 (patch)
treebd707ad1c1ecb28492360b7f8d4c5d7a294e3948
parent9145dd6971f17079ac1b2b8eb38c12146f980ff9 (diff)
checklist : c/show shortcode can now embed an optinal hidden input field
-rw-r--r--exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md2
-rw-r--r--layouts/shortcodes/c/show.html7
2 files changed, 7 insertions, 2 deletions
diff --git a/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md b/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md
index 1c2e997..195bea3 100644
--- a/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md
+++ b/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md
@@ -10,7 +10,7 @@ Because no system is entirely free of security issues, it's important to provide
{{</c/choices>}}
-{{<c/show `{app_vuln_report_way} == 'no'` >}}
+{{<c/show `{app_vuln_report_way} == 'no'` warn_app_vuln_report_way_no >}}
{{%notice warning%}}
**Warning — possible medium-risk issue**\
\
diff --git a/layouts/shortcodes/c/show.html b/layouts/shortcodes/c/show.html
index 8eda479..637f430 100644
--- a/layouts/shortcodes/c/show.html
+++ b/layouts/shortcodes/c/show.html
@@ -8,5 +8,10 @@
{{ $conditionFix = replace $conditionFix ` or ` ` || ` }}
{{ $conditionFix = replaceRE `[^)]+has\s+('\w+')` ".includes($1)" $conditionFix }}
-<div id="{{$id}}" class="baz" style="display:none">{{.Inner | markdownify}}</div>
+<div id="{{$id}}" class="baz" style="display:none">
+{{with .Get 1}}
+<input type="hidden" value="true" name="{{.}}">
+{{end}}
+{{.Inner | markdownify}}</div>
<script type="text/javascript">$(registerShowIf('{{$id}}','{{$conditionFix}}'))</script>
+