noparse header to disable bashdown on snippet
This commit is contained in:
parent
36ccda5f30
commit
7e7b0a8c65
7
snippy
7
snippy
@ -5,6 +5,7 @@
|
||||
# . restore current clipboard
|
||||
# . {clipboard} placeholder to use current clipboard in snippet
|
||||
# . {cursor} placeholder to place the cursor
|
||||
# . ##noparse header in snippet to not parse
|
||||
# augmented by "opennomad": https://gist.github.com/opennomad/15c4d624dce99066a82d
|
||||
# originally written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2
|
||||
# Based on "snippy" by "sessy"
|
||||
@ -74,9 +75,9 @@ run(){
|
||||
|
||||
if [ -f "${DIR}/${FILE}" ]; then
|
||||
# Put the contents of the selected file into the paste buffer.
|
||||
# bang is a bash template, don't pass it to bashdown
|
||||
if [[ ${FILE} == "bang" ]]; then
|
||||
content="$(cat "${DIR}/${FILE}")"
|
||||
# don't parse file with the ##noparse header
|
||||
if grep -qE "^##noparse" "${FILE}"; then
|
||||
content="$(tail -n +2 "${DIR}/${FILE}")"
|
||||
else
|
||||
content="$(bashdown < "${DIR}/${FILE}")"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user