Skip to content

Commit

Permalink
Merge pull request #1933 from dedis/work-bug-daniel-embedme
Browse files Browse the repository at this point in the history
fix embedme not working
  • Loading branch information
K1li4nL authored Jun 14, 2024
2 parents 942eea7 + e23677d commit 0450bf5
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 212 deletions.
5 changes: 2 additions & 3 deletions docs/embedme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BEGIN {
{
# if this is a closing block line, unsets the del variable to stop deleting
# lines if it was the case
if ($0 ~ /^\`\`\`$/) {
if ($0 ~ /^```$/) {
del=0;
print $0;

Expand All @@ -44,15 +44,14 @@ BEGIN {

# if this is the start of an opening block, we indicate that with the
# last_line variable
} else if ($0 ~ /\`\`\`json5/) {
} else if ($0 ~ /```json5/) {
last_line=1;
print $0;

# if the previous line was an opening block, and we get a comment, then
# let's fill the block with the file's content and remove the old lines from
# the block. $1 will contain "//" and $2 will contain the filename.
} else if ($0 ~ /\/\/ .+\.json/ && last_line == 1) {

# check if the file exists.
if (system("test -f " $2)==0) {
print $0;
Expand Down
Loading

0 comments on commit 0450bf5

Please sign in to comment.