Skip to content

Commit

Permalink
Re-add section about pre tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshvarun committed Sep 6, 2023
1 parent cce479f commit 88ae55a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ Cells can be configured with the following attributes:
- `data-autorun="true"` - Automatically run a cell on page load. Autorun cells are run in the order that they appear on the page.
- `data-hidden="true"` - Make a cell hidden by default - readers can toggle the cell's visibility.

### Using `<pre>` tags instead of `<script>` tags

Script tags are great for defining notebook cells since they can hold pretty much any code without escaping. However, you can also use `<pre class="notebook-cell">` tags instead. When using `pre` tags, reserved HTML characters should be escaped using HTML entities (this can be done by your static site generator).

```
<pre class="notebook-cell">
console.log("&lt;b&gt;HELLO&lt;/b&gt;");
</pre>
```

## Developing

```
Expand Down

0 comments on commit 88ae55a

Please sign in to comment.