mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 09:49:46 +02:00
Add comments
This commit is contained in:
@@ -76,6 +76,15 @@ function computeWidthOfText(parentNode: any, lineHeight: number, line: MarkdownL
|
||||
return textLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a formatted text element by breaking lines and applying styles based on
|
||||
* the given structuredText.
|
||||
*
|
||||
* @param width - The maximum allowed width of the text.
|
||||
* @param g - The parent group element to append the formatted text.
|
||||
* @param structuredText - The structured text data to format.
|
||||
* @param addBackground - Whether to add a background to the text.
|
||||
*/
|
||||
function createFormattedText(
|
||||
width: number,
|
||||
g: any,
|
||||
@@ -117,6 +126,13 @@ function createFormattedText(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the text content and styles of the given tspan element based on the
|
||||
* provided wrappedLine data.
|
||||
*
|
||||
* @param tspan - The tspan element to update.
|
||||
* @param wrappedLine - The line data to apply to the tspan element.
|
||||
*/
|
||||
function updateTextContentAndStyles(tspan: any, wrappedLine: MarkdownWord[]) {
|
||||
tspan.text('');
|
||||
|
||||
|
Reference in New Issue
Block a user