tests/testthat/_snaps/utils_rich_text.md

get correct request parameters from get_param_highlight_text()

[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      512


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"



[[2]]
[[2]]$updateTextStyle
[[2]]$updateTextStyle$range
[[2]]$updateTextStyle$range$startIndex
start_index 
        513

[[2]]$updateTextStyle$range$endIndex
end_index 
      603


[[2]]$updateTextStyle$textStyle
[[2]]$updateTextStyle$textStyle$backgroundColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[2]]$updateTextStyle$fields
[1] "*"



[[3]]
[[3]]$updateTextStyle
[[3]]$updateTextStyle$range
[[3]]$updateTextStyle$range$startIndex
start_index 
        605

[[3]]$updateTextStyle$range$endIndex
end_index 
      671


[[3]]$updateTextStyle$textStyle
[[3]]$updateTextStyle$textStyle$backgroundColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[3]]$updateTextStyle$fields
[1] "*"
[[1]]
[1] "#----Trackdown Instructions----#\nThis is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code.\nOnce the review is over accept all changes: Tools -> Review suggested edits -> Accept all.\nYou must not modify or remove these lines, we will do it for you ;)\nFILE-NAME: example-rich-text.Rmd\nHIDE-CODE: FALSE\n#----End Instructions----#\n"

[[2]]
[1] "---\ntitle: \"Trackdown Test\"\nauthor: \"trackdown\"\ndate: \"2/3/2021\"\noutput: html_document\n---\n"

[[3]]
[1] "```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```\n"

[[4]]
[1] "```{r cars}\nsummary(cars)\n```\n"

[[5]]
[1] "```{r, pressure, echo=FALSE}\nplot(pressure)\n```\n"

[[6]]
[1] "```{r, echo=FALSE, warning=FALSE}\n# R chunk with no name but multiple options (using ,)\n```\n"

[[7]]
[1] "```{sql, eval=FALSE}\n/*A sql chunk chunk with no name but options*/\n```\n"

[[8]]
[1] "```{eval = TRUE}\nA void code\n```\n"

[[9]]
[1] "```{}\nAnother void code\n```\n"

[[10]]
[1] "```\nStill another void code\n```\n"

[[11]]
[1] "``` {r}\n# a strange chuck header with space before {\n```\n"

[[12]]
[1] "``` bash\n$ pwd 1\n```\n"

[[13]]
[1] "``` bash\n$ pwd 2\n```\n"

[[14]]
[1] "`r sum(1:5)`\n"

[[15]]
[1] "`r sum(1:5)` "

[[16]]
[1] "`r \"Hello World!!!\"` "

[[17]]
[1] "`r sum(1:5)`!"

[[18]]
[1] "`r \"Hello World!!!\"` "
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      588


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"



[[2]]
[[2]]$updateTextStyle
[[2]]$updateTextStyle$range
[[2]]$updateTextStyle$range$startIndex
start_index 
        589

[[2]]$updateTextStyle$range$endIndex
end_index 
      608


[[2]]$updateTextStyle$textStyle
[[2]]$updateTextStyle$textStyle$backgroundColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[2]]$updateTextStyle$fields
[1] "*"



[[3]]
[[3]]$updateTextStyle
[[3]]$updateTextStyle$range
[[3]]$updateTextStyle$range$startIndex
start_index 
        610

[[3]]$updateTextStyle$range$endIndex
end_index 
      625


[[3]]$updateTextStyle$textStyle
[[3]]$updateTextStyle$textStyle$backgroundColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[3]]$updateTextStyle$fields
[1] "*"
[[1]]
[1] "#----Trackdown Instructions----#\nThis is not a common Document. The Document includes properly formatted Markdown syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code.\nPlease do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\"\nOnce the review is over accept all changes: Tools -> Review suggested edits -> Accept all.\nYou must not modify or remove these lines, we will do it for you ;)\nFILE-NAME: rmd-main.Rmd\nHIDE-CODE: TRUE\n#----End Instructions----#\n"

[[2]]
[1] "[[document-header]]\n"

[[3]]
[1] "[[chunk-setup]]\n"

[[4]]
[1] "[[chunk-cars]]\n"

[[5]]
[1] "[[chunk-pressure]]\n"

[[6]]
[1] "[[chunk-4]]\n"

[[7]]
[1] "[[chunk-5]]\n"

[[8]]
[1] "[[chunk-6]]\n"

[[9]]
[1] "[[chunk-7]]\n"

[[10]]
[1] "[[chunk-8]]\n"

[[11]]
[1] "[[chunk-9]]\n"

[[12]]
[1] "[[chunk-10]]\n"

[[13]]
[1] "[[chunk-11]]\n"

[[14]]
[1] "`r sum(1:5)`\n"

[[15]]
[1] "`r sum(1:5)` "

[[16]]
[1] "`r \"Hello World!!!\"` "

[[17]]
[1] "`r sum(1:5)`!"

[[18]]
[1] "`r \"Hello World!!!\"` "
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      512


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      512


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 0.4

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 1





[[1]]$updateTextStyle$fields
[1] "*"
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      500


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"



[[2]]
[[2]]$updateTextStyle
[[2]]$updateTextStyle$range
[[2]]$updateTextStyle$range$startIndex
start_index 
        535

[[2]]$updateTextStyle$range$endIndex
end_index 
     1242


[[2]]$updateTextStyle$textStyle
[[2]]$updateTextStyle$textStyle$backgroundColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[2]]$updateTextStyle$fields
[1] "*"



[[3]]
[[3]]$updateTextStyle
[[3]]$updateTextStyle$range
[[3]]$updateTextStyle$range$startIndex
start_index 
       1086

[[3]]$updateTextStyle$range$endIndex
end_index 
     1148


[[3]]$updateTextStyle$textStyle
[[3]]$updateTextStyle$textStyle$backgroundColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[3]]$updateTextStyle$fields
[1] "*"
[[1]]
[1] "#----Trackdown Instructions----#\nThis is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code.\nOnce the review is over accept all changes: Tools -> Review suggested edits -> Accept all.\nYou must not modify or remove these lines, we will do it for you ;)\nFILE-NAME: rnw-main.Rnw\nHIDE-CODE: FALSE\n#----End Instructions----#\n"

[[2]]
[1] "\\documentclass{article}  \n\\usepackage[T1] {fontenc} \t\t  % Font encoding\n\\usepackage [utf8] {inputenc}\t\t% Encoding for the document\n\\usepackage[a4paper,includeheadfoot,top=2.4cm, bottom=2cm, left=2.4cm, right=2.4cm]{geometry}  % margin settings\n\\usepackage[english]{babel}      \n\n%----    Other packages    ----%\n\\usepackage{tikz}       \n\\usepackage{graphicx}   % for including graphics\n\\usepackage{amsmath}    % for math equation\n\\usepackage{hyperref}    % ref between elements\n\n%%%%%%%%%%%%%%%%%%%%%%          Settings        %%%%%%%%%%%%%%%%%%%%%%\n\n<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n\n% Document title info\n\\title{Reviewdown Test}\n\\author{reviewdown}\n% \\date{}\n\\begin{document}\n"

[[3]]
[1] "<<setup, include=FALSE>>=\nknitr::opts_chunk$set(echo = TRUE)\n@\n"

[[4]]
[1] "<<cars>>= #some text\nsummary(cars)\n@ "

[[5]]
[1] "<<pressure, echo=FALSE>>=\nplot(pressure)\n@\n"

[[6]]
[1] "<<echo=FALSE, warning=FALSE>>=\n# R chunk with no name but multiple options (using ,)\n3+3\n@\n"

[[7]]
[1] "<<echo=FALSE>>= # a really evil comment\n# R chunk with no name but options (not using,)\n@\n"

[[8]]
[1] "<<sql, eval=FALSE>>=\n/*A  wrong sql chunk chunk with no name but options*/\n@\n"

[[9]]
[1] "<<>>=\n# A void code block\n@\n"

[[10]]
[1] "\\Sexpr{sum(1:5)}\n"

[[11]]
[1] "\\Sexpr{sum(1:5)} "

[[12]]
[1] "\\Sexpr{\"Hello World!!!\"} "
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      585


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"



[[2]]
[[2]]$updateTextStyle
[[2]]$updateTextStyle$range
[[2]]$updateTextStyle$range$startIndex
start_index 
        586

[[2]]$updateTextStyle$range$endIndex
end_index 
      605


[[2]]$updateTextStyle$textStyle
[[2]]$updateTextStyle$textStyle$backgroundColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[2]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[2]]$updateTextStyle$fields
[1] "*"



[[3]]
[[3]]$updateTextStyle
[[3]]$updateTextStyle$range
[[3]]$updateTextStyle$range$startIndex
start_index 
       1554

[[3]]$updateTextStyle$range$endIndex
end_index 
     1568


[[3]]$updateTextStyle$textStyle
[[3]]$updateTextStyle$textStyle$backgroundColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[3]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[3]]$updateTextStyle$fields
[1] "*"
[[1]]
[1] "#----Trackdown Instructions----#\nThis is not a common Document. The Document includes properly formatted LaTeX syntax and R code. Please be aware and responsible in making corrections as you could break the code. Limit changes to narrative text and avoid modifying R code.\nPlease do not remove placeholders of type \"[[chunk-<name>]]\" or \"[[document-header]]\"\nOnce the review is over accept all changes: Tools -> Review suggested edits -> Accept all.\nYou must not modify or remove these lines, we will do it for you ;)\nFILE-NAME: rnw-main.Rnw\nHIDE-CODE: TRUE\n#----End Instructions----#\n"

[[2]]
[1] "[[document-header]]\n"

[[3]]
[1] "[[chunk-cars]]\n"

[[4]]
[1] "[[chunk-pressure]]\n"

[[5]]
[1] "[[chunk-3]]\n"

[[6]]
[1] "[[chunk-4]]\n"

[[7]]
[1] "[[chunk-sql]]\n"

[[8]]
[1] "[[chunk-6]]\n"

[[9]]
[1] "\\Sexpr{sum(1:5)}\n"

[[10]]
[1] "\\Sexpr{sum(1:5)} "

[[11]]
[1] "\\Sexpr{\"Hello World!!!\"} "
[[1]]
[[1]]$updateTextStyle
[[1]]$updateTextStyle$range
[[1]]$updateTextStyle$range$startIndex
start_index 
          1

[[1]]$updateTextStyle$range$endIndex
end_index 
      500


[[1]]$updateTextStyle$textStyle
[[1]]$updateTextStyle$textStyle$backgroundColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor
[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

[[1]]$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





[[1]]$updateTextStyle$fields
[1] "*"

get correct patterns from get_patterns_highlight()

                                                         instructions 
"#----Trackdown Instructions----#[\\s\\S]*#----End Instructions----#" 
                                                                 tags 
                            "(?<=\n)\\[\\[(document|chunk)-.+?\\]\\]" 
                                                     inline_equations 
                                  "(?<!\\\\)\\$\\S.+?\\S(?<!\\\\)\\$" 
                                                            equations 
  "(?<!\\\\)\\$\\$(?!\\s*\n\\s*\n)[\\s\\S]*?(?<!\n\n)(?<!\\\\)\\$\\$" 
                                                               header 
                "(?<=#----End Instructions----#\n)---[\\s\\S]*?\n---" 
                                                               chunks 
                                     "(?<=\n)```[^`]*\n[\\s\\S]*?```" 
                                                          inline_code 
                                                          "`r [^`]+`" 
                                                            citations 
                                     "(?<![a-zA-Z0-9.])-?@[^\\s\\]]+"
                                                         instructions 
"#----Trackdown Instructions----#[\\s\\S]*#----End Instructions----#" 
                                                                 tags 
                            "(?<=\n)\\[\\[(document|chunk)-.+?\\]\\]" 
                                                     inline_equations 
                                  "(?<!\\\\)\\$\\S.+?\\S(?<!\\\\)\\$" 
                                                            equations 
  "(?<!\\\\)\\$\\$(?!\\s*\n\\s*\n)[\\s\\S]*?(?<!\n\n)(?<!\\\\)\\$\\$" 
                                                               header 
     "(?<!\\\\)\\\\documentclass\\{[\\s\\S]*?\\\\begin\\{document\\}" 
                                                               chunks 
                                       "<<.*?>>=[\\s\\S]*?\\s*@\\s*?" 
                                                          inline_code 
                                                     "\\\\Sexpr{.+?}"

citations are correctly matched

  start_index end_index
1          81        90
2         137       147
3         159       173
4         303       317
5         361       376
6         418       427
7         436       446
8         470       480

equations are correctly matched

  start_index end_index
1          37        49
2          63        68
3         381       392
  start_index end_index
1         167       192
2         220       238
3         271       307
4         333       355
5         381       392

get correct range indexes from get_range_index()

   start_index end_index
1          605       671
2         2245      2274
3         2336      2383
4         2512      2603
5         2605      2676
6         2678      2710
7         2712      2739
8         2741      2772
9         2812      2868
10        2870      2890
11        2892      2912
   start_index end_index
1          589       608
2          610       625
3         2199      2213
4         2275      2293
5         2422      2433
6         2435      2446
7         2448      2459
8         2461      2472
9         2474      2485
10        2525      2536
11        2538      2550
12        2552      2564
  start_index end_index
1        1086      1148
2        2191      2227
3        2302      2344
4        2473      2563
5        2565      2654
6        2656      2732
7        2734      2761
  start_index end_index
1         586       605
2        1554      1568
3        1637      1655
4        1784      1795
5        1797      1808
6        1810      1823
7        1825      1836

get correct template from template_highlight_text()

$updateTextStyle
$updateTextStyle$range
$updateTextStyle$range$startIndex
[1] 1

$updateTextStyle$range$endIndex
[1] 100


$updateTextStyle$textStyle
$updateTextStyle$textStyle$backgroundColor
$updateTextStyle$textStyle$backgroundColor$color
$updateTextStyle$textStyle$backgroundColor$color$rgbColor
$updateTextStyle$textStyle$backgroundColor$color$rgbColor$red
[1] 1

$updateTextStyle$textStyle$backgroundColor$color$rgbColor$green
[1] 0.8

$updateTextStyle$textStyle$backgroundColor$color$rgbColor$blue
[1] 0.4





$updateTextStyle$fields
[1] "*"


ekothe/trackdown documentation built on June 28, 2023, 4:57 p.m.