From 4e1a5605b188aa8357fa08fd4900e9202a0cb401 Mon Sep 17 00:00:00 2001 From: Dave Pagurek Date: Fri, 20 Mar 2026 08:03:28 -0400 Subject: [PATCH] Unescape < and > in inline code in docs --- src/core/p5.Graphics.js | 4 +-- src/core/rendering.js | 4 +-- src/dom/dom.js | 52 +++++++++++++++++++------------------- src/dom/p5.Element.js | 4 +-- src/dom/p5.MediaElement.js | 6 ++--- src/io/files.js | 2 +- src/io/p5.XML.js | 16 ++++++------ 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/core/p5.Graphics.js b/src/core/p5.Graphics.js index cb102aee5d..736cd59ad0 100644 --- a/src/core/p5.Graphics.js +++ b/src/core/p5.Graphics.js @@ -240,7 +240,7 @@ class Graphics { * Removes the graphics buffer from the web page. * * Calling `myGraphics.remove()` removes the graphics buffer's - * `<canvas>` element from the web page. The graphics buffer also uses + * `` element from the web page. The graphics buffer also uses * a bit of memory on the CPU that can be freed like so: * * ```js @@ -597,7 +597,7 @@ function graphics(p5, fn){ * @param {Number} h height height of the graphics buffer in pixels. * @param {(P2D|WEBGL|P2DHDR)} renderer the renderer to use, either P2D or WEBGL. * @param {p5} [pInst] sketch instance. - * @param {HTMLCanvasElement} [canvas] existing `<canvas>` element to use. + * @param {HTMLCanvasElement} [canvas] existing `` element to use. * * @example * let pg; diff --git a/src/core/rendering.js b/src/core/rendering.js index 7521911ec1..dd9051508d 100644 --- a/src/core/rendering.js +++ b/src/core/rendering.js @@ -607,9 +607,9 @@ function rendering(p5, fn){ /** * A system variable that provides direct access to the sketch's - * `<canvas>` element. + * `` element. * - * The `<canvas>` element provides many specialized features that aren't + * The `` element provides many specialized features that aren't * included in the p5.js library. The `drawingContext` system variable * provides access to these features by exposing the sketch's * CanvasRenderingContext2D diff --git a/src/dom/dom.js b/src/dom/dom.js index 7fb1fe1334..9f1dcb14c7 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -371,16 +371,16 @@ function dom(p5, fn){ } /** - * Creates a `<div></div>` element. + * Creates a `
` element. * - * `<div></div>` elements are commonly used as containers for + * `
` elements are commonly used as containers for * other elements. * * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<div></div>`. + * inner HTML of the new `
`. * * @method createDiv - * @param {String} [html] inner HTML for the new `<div></div>` element. + * @param {String} [html] inner HTML for the new `
` element. * @return {p5.Element} new p5.Element object. * * @example @@ -418,13 +418,13 @@ function dom(p5, fn){ /** * Creates a paragraph element. * - * `<p></p>` elements are commonly used for paragraph-length text. + * `

` elements are commonly used for paragraph-length text. * * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<p></p>`. + * inner HTML of the new `

`. * * @method createP - * @param {String} [html] inner HTML for the new `<p></p>` element. + * @param {String} [html] inner HTML for the new `

` element. * @return {p5.Element} new p5.Element object. * * @example @@ -447,18 +447,18 @@ function dom(p5, fn){ }; /** - * Creates a `<span></span>` element. + * Creates a `` element. * - * `<span></span>` elements are commonly used as containers - * for inline elements. For example, a `<span></span>` + * `` elements are commonly used as containers + * for inline elements. For example, a `` * can hold part of a sentence that's a * different style. * * The parameter `html` is optional. It accepts a string that sets the - * inner HTML of the new `<span></span>`. + * inner HTML of the new ``. * * @method createSpan - * @param {String} [html] inner HTML for the new `<span></span>` element. + * @param {String} [html] inner HTML for the new `` element. * @return {p5.Element} new p5.Element object. * * @example @@ -511,7 +511,7 @@ function dom(p5, fn){ }; /** - * Creates an `<img>` element that can appear outside of the canvas. + * Creates an `` element that can appear outside of the canvas. * * The first parameter, `src`, is a string with the path to the image file. * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as @@ -582,7 +582,7 @@ function dom(p5, fn){ }; /** - * Creates an `<a></a>` element that links to another web page. + * Creates an `` element that links to another web page. * * The first parmeter, `href`, is a string that sets the URL of the linked * page. @@ -639,7 +639,7 @@ function dom(p5, fn){ /* INPUT */ /** - * Creates a slider `<input></input>` element. + * Creates a slider `` element. * * Range sliders are useful for quickly selecting numbers from a given range. * @@ -761,7 +761,7 @@ function dom(p5, fn){ }; /** - * Creates a `<button></button>` element. + * Creates a `` element. * * The first parameter, `label`, is a string that sets the label displayed on * the button. @@ -838,7 +838,7 @@ function dom(p5, fn){ }; /** - * Creates a checkbox `<input></input>` element. + * Creates a checkbox `` element. * * Checkboxes extend the p5.Element class with a * `checked()` method. Calling `myBox.checked()` returns `true` if it the box @@ -979,11 +979,11 @@ function dom(p5, fn){ }; /** - * Creates a dropdown menu `<select></select>` element. + * Creates a dropdown menu `` element. * * The parameter is optional. If `true` is passed, as in * `let mySelect = createSelect(true)`, then the dropdown will support - * multiple selections. If an existing `<select></select>` element + * multiple selections. If an existing `` element * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing * element will be wrapped in a new p5.Element * object. @@ -1250,8 +1250,8 @@ function dom(p5, fn){ * * The parameter is optional. If a string is passed, as in * `let myRadio = createSelect('food')`, then each radio option will - * have `"food"` as its `name` parameter: `<input name="food"></input>`. - * If an existing `<div></div>` or `<span></span>` + * have `"food"` as its `name` parameter: ``. + * If an existing `
` or `` * element is passed, as in `let myRadio = createSelect(container)`, it will * become the radio button's parent element. * @@ -1264,8 +1264,8 @@ function dom(p5, fn){ * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed. * * @method createRadio - * @param {Object} [containerElement] container HTML Element, either a `<div></div>` - * or `<span></span>`. + * @param {Object} [containerElement] container HTML Element, either a `
` + * or ``. * @return {p5.Element} new p5.Element object. * * @example @@ -1384,7 +1384,7 @@ function dom(p5, fn){ */ /** * @method createRadio - * @param {String} [name] name parameter assigned to each option's `<input></input>` element. + * @param {String} [name] name parameter assigned to each option's `` element. * @return {p5.Element} new p5.Element object. */ /** @@ -1651,7 +1651,7 @@ function dom(p5, fn){ }; /** - * Creates a text `<input></input>` element. + * Creates a text `` element. * * Call `myInput.size()` to set the length of the text box. * @@ -1727,7 +1727,7 @@ function dom(p5, fn){ }; /** - * Creates an `<input></input>` element of type `'file'`. + * Creates an `` element of type `'file'`. * * `createFileInput()` allows users to select local files for use in a sketch. * It returns a p5.File object. diff --git a/src/dom/p5.Element.js b/src/dom/p5.Element.js index 5c97460655..08dcc6260a 100644 --- a/src/dom/p5.Element.js +++ b/src/dom/p5.Element.js @@ -92,9 +92,9 @@ class Element { /** * Attaches the element to a parent element. * - * For example, a `<div></div>` element may be used as a box to + * For example, a `
` element may be used as a box to * hold two pieces of text, a header and a paragraph. The - * `<div></div>` is the parent element of both the header and + * `
` is the parent element of both the header and * paragraph. * * The parameter `parent` can have one of three types. `parent` can be a diff --git a/src/dom/p5.MediaElement.js b/src/dom/p5.MediaElement.js index 9a9890d8ff..84f93e9cfd 100644 --- a/src/dom/p5.MediaElement.js +++ b/src/dom/p5.MediaElement.js @@ -1319,7 +1319,7 @@ function media(p5, fn){ } /** - * Creates a `<video>` element for simple audio/video playback. + * Creates a `