# QuoteNode
Class Inherits TextNode
## About
`QuoteNode` displays quoted rich text beside a quote bar, with an optional citation shown below it. It supports the complete rich-text editing API of `TextNode`; the citation is plain text set in code or from the inspector.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Constructor | value As String = "" | (None) | Creates a new quote node containing the supplied text. |
| Duplicate | (None) | Node | Returns an independent copy of this node and its configurable state. |
| ExportStyles | stylesheet As GraffitiProEditor.Stylesheet | (None) | Adds the stylesheet rules this node type's HTML output uses. |
| FromHTML | element As GraffitiProEditor.HTMLSupport.HTMLElement | Boolean | Imports a blockquote and its attribution from an HTML element. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON data and returns whether it succeeded. |
| HTMLImportPriority | element As GraffitiProEditor.HTMLSupport.HTMLElement | Integer | Returns this node type's priority when resolving an HTML element importer. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the quote properties exposed by the inspector. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of this node type's main-toolbar item. |
| PreferredHeight | g As Graphics <br> availableWidth As Double | Double | Returns the preferred node height for the available width. |
| Render | g As Graphics <br> bounds As Rect <br> selected As Boolean | (None) | Draws the node within the supplied document bounds. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns a JSON representation of this object's persistent state. |
| ToMarkdown | (None) | String | Returns a Markdown representation of this content. |
| TypeName | (None) | String | Returns the display name for this node type. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Citation | String | (None) | Gets or sets the attribution shown below the quote. Empty hides it. |
## Notes
An empty `Citation` hides the citation line. The citation is drawn in italic at 85 percent of the quote's font size and is preceded by an em dash.
### HTML and Markdown
HTML export writes a `blockquote` with the `quote` class. The citation is a `footer` containing a `cite` element inside it. HTML import takes the citation from a `footer` or `cite` child and imports the remaining children as the quoted text.
`QuoteNode` imports blockquotes ahead of `AlertNode`, which also accepts them. A blockquote with an `alert` class is left to `AlertNode`.
Markdown export writes `>` lines, with the citation as a final line starting with an em dash. Markdown import treats a final quote line starting with `— ` or `-- ` as the citation.
### JSON Format
`citation` is a string. The quoted text uses the `TextNode` and `TextSnapshot` JSON formats.
`citation` is omitted when empty.
## Examples
Register a quote prototype before inserting, importing, or restoring quotes.
### Quote with Citation
```xojo
Editor.NodeTypes.Add(New GraffitiProEditor.QuoteNode)
Var quote As New GraffitiProEditor.QuoteNode("Simplicity is prerequisite for reliability.")
quote.Citation = "Edsger W. Dijkstra"
Editor.AddNode(quote)
```