aboutsummaryrefslogtreecommitdiff
path: root/ext/js/dom/dom-text-scanner.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-05-20 10:28:38 -0400
committerGitHub <noreply@github.com>2022-05-20 10:28:38 -0400
commit31e20c889e467aa4ba64b0b5baf602adc1359371 (patch)
treea033db935a817b2d407ec20843176610a87a6e16 /ext/js/dom/dom-text-scanner.js
parentae0ad227c0fd293609a21e5cc1d2a4b85fe7c520 (diff)
ESlint JSdoc (#2148)
* Install eslint-plugin-jsdoc * Initial rules setup * Update lists * Use @returns rather than @return * Remove error throwing code which is never executed * Fix issues relating to @throws * General error fixes * Update Display type documentation * Various doc fixes * Fix invalid tuple syntax * Doc updates * Remove unused * Doc updates * Enable jsdoc/require-returns * Update rules * Update remaining rules
Diffstat (limited to 'ext/js/dom/dom-text-scanner.js')
-rw-r--r--ext/js/dom/dom-text-scanner.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/js/dom/dom-text-scanner.js b/ext/js/dom/dom-text-scanner.js
index fff08825..83b16028 100644
--- a/ext/js/dom/dom-text-scanner.js
+++ b/ext/js/dom/dom-text-scanner.js
@@ -21,9 +21,12 @@
class DOMTextScanner {
/**
* Creates a new instance of a DOMTextScanner.
- * @param node The DOM Node to start at.
- * @param offset The character offset in to start at when node is a text node.
+ * @param {Node} node The DOM Node to start at.
+ * @param {number} offset The character offset in to start at when node is a text node.
* Use 0 for non-text nodes.
+ * @param {boolean} forcePreserveWhitespace Whether or not whitespace should be forced to be preserved,
+ * regardless of CSS styling.
+ * @param {boolean} generateLayoutContent Whether or not newlines should be added based on CSS styling.
*/
constructor(node, offset, forcePreserveWhitespace=false, generateLayoutContent=true) {
const ruby = DOMTextScanner.getParentRubyElement(node);
@@ -393,6 +396,7 @@ class DOMTextScanner {
/**
* Gets seek information about an element.
+ * @param {Element} element The element to check.
* @returns {{enterable: boolean, newlines: number}} The seek information.
* The `enterable` value indicates whether the content of this node should be entered.
* The `newlines` value corresponds to the number of newline characters that should be added.
@@ -443,6 +447,8 @@ class DOMTextScanner {
/**
* Gets attributes for the specified character.
* @param {string} character A string containing a single character.
+ * @param {boolean} preserveNewlines Whether or not newlines should be preserved.
+ * @param {boolean} preserveWhitespace Whether or not whitespace should be preserved.
* @returns {number} An integer representing the attributes of the character.
* 0: Character should be ignored.
* 1: Character is collapsible whitespace.