mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -14,8 +14,9 @@ const EXCLUDED_CLASSES = ['katex-mathml']
|
|||
/**
|
||||
* Checks whether the given node is an excluded HTML tag and therefore should be
|
||||
* excluded from counting.
|
||||
*
|
||||
* @param node The node to test.
|
||||
* @return true if the node should be excluded, false otherwise.
|
||||
* @return {@link true} if the node should be excluded, {@link false} otherwise.
|
||||
*/
|
||||
const isExcludedTag = (node: Element | ChildNode): boolean => {
|
||||
return EXCLUDED_TAGS.includes(node.nodeName.toLowerCase())
|
||||
|
@ -24,8 +25,9 @@ const isExcludedTag = (node: Element | ChildNode): boolean => {
|
|||
/**
|
||||
* Checks whether the given node is a HTML element with an excluded class name,
|
||||
* so that it should be excluded.
|
||||
*
|
||||
* @param node The node to test.
|
||||
* @return true if the node should be excluded, false otherwise.
|
||||
* @return {@link true} if the node should be excluded, {@link false} otherwise.
|
||||
*/
|
||||
const isExcludedClass = (node: Element | ChildNode): boolean => {
|
||||
return EXCLUDED_CLASSES.some((excludedClass) => (node as HTMLElement).classList?.contains(excludedClass))
|
||||
|
@ -33,7 +35,8 @@ const isExcludedClass = (node: Element | ChildNode): boolean => {
|
|||
|
||||
/**
|
||||
* Counts the words of the given node while ignoring empty nodes and excluded
|
||||
* nodes. Child nodes will recursively counted as well.
|
||||
* nodes. Child nodes will recursively be counted as well.
|
||||
*
|
||||
* @param node The node whose content's words should be counted.
|
||||
* @return The number of words counted in this node and its children.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue