Raw editor text has been taken from an active RStudio session via rstudioapi::getSourceEditorContext(). Chunk delimiters and html is removed, all formatting is otherwise preserved.

code_from_editor(.contents, chunk_name)

Arguments

.contents

chunk contents passed from editor context

chunk_name

label of chunk

Value

chunk text