Skip to content

Commit d4c1fc9

Browse files
committed
escape : in front matter automatically
1 parent 8c17760 commit d4c1fc9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

_posts/2012-12-14-transforming-a-matrix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: Romain Francois
44
license: GPL (>= 2)
55
tags: matrix stl featured
66
summary: Demonstrates transforming a matrix passed to a function
7-
using std::transform.
7+
using std::transform.
88
layout: post
99
src: 2012-12-14-transforming-a-matrix.cpp
1010
---

_scripts/knit.sh

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ readInputFile <- function(inputFile) {
3737
if (delimiters[2] - delimiters[1] <= 1)
3838
stop("Empty front-matter section in post")
3939
frontMatter <- input[(delimiters[1]+1):(delimiters[2]-1)]
40+
41+
# escape : globally then restore the initial :
42+
frontMatter <- gsub(":", "&#58;", frontMatter, fixed = TRUE)
43+
frontMatter <- sub("&#58;", ":", frontMatter, fixed = TRUE)
4044

4145
# validate and ammend front matter as necessary
4246
hasField <- function(field) {

0 commit comments

Comments
 (0)