Paragraph should be composed. #9

Closed
opened 2025-10-14 13:00:15 -07:00 by azpect · 0 comments
Owner

A Paragraph class will exist, and this node will be composed of a list of `TextNode's which are simply text.

However, ItalicNode's will inherit from TextNode but use <em> tags when generated.
However, BoldNode's will inherit from TextNode but use <strong> tags when generated.

The Paragraph class will place all of the elements RIGHT next to each other, unless breaks exist.

This note is a bit complicated, but here is a Gemini prompt to help out a bit:

...

These objects are organized into a tree. For example, a Document object at the root would have Paragraph and Heading objects as its children. A Paragraph object could, in turn, have BoldText and ItalicText objects as its children. This is a classic example of object composition where a parent object contains a collection of child objects.

...
A `Paragraph` class will exist, and this node will be composed of a list of `TextNode's which are simply text. However, `ItalicNode`'s will inherit from `TextNode` but use `<em>` tags when generated. However, `BoldNode`'s will inherit from `TextNode` but use `<strong>` tags when generated. The `Paragraph` class will place all of the elements RIGHT next to each other, unless breaks exist. This note is a bit complicated, but here is a Gemini prompt to help out a bit: ``` ... These objects are organized into a tree. For example, a Document object at the root would have Paragraph and Heading objects as its children. A Paragraph object could, in turn, have BoldText and ItalicText objects as its children. This is a classic example of object composition where a parent object contains a collection of child objects. ... ```
azpect added the
Kind/Feature
Priority
Low
labels 2025-10-14 13:00:15 -07:00
azpect added this to the (SPRINT) Internal HTML Tree Generation (DOM) project 2025-10-14 13:00:15 -07:00
azpect moved this to Done in (SPRINT) Internal HTML Tree Generation (DOM) on 2025-10-17 13:19:40 -07:00
Sign in to join this conversation.
No description provided.