Created
April 12, 2018 05:01
-
-
Save AliciaSchep/ea472176ae9a75237be6a863af14f942 to your computer and use it in GitHub Desktop.
Example document showcasing a bug with inappropriate insertion of wheel event listener by rstudio in rmarkdown inline view / notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "event listener bug" | |
author: "Alicia Schep" | |
date: "April 11, 2018" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
## Example of inappropriate wheel event listener insertion by rstudio in rmarkdown inline view | |
```{r} | |
library(htmltools) | |
``` | |
```{r} | |
download.file("https://cdn.jsdelivr.net/npm/[email protected]/build/vega-embed.js", | |
"vega-embed.js") | |
``` | |
```{r} | |
ve_dep <- htmlDependency("vega-embed", "3.1.1", | |
src = getwd(), | |
script = "vega-embed.js") | |
``` | |
If you look at the console, there is an error "SyntaxError: Expected an identifier but found 'text' instead". When you look at the line of code that generates that error, it appears that the wheel event listener has been inserted into the vega-embed.js source. | |
```{r} | |
tagList(ve_dep,tags$h3("check console")) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment