Paragraph Element (p)
The p element is a single paragraph with a single main idea. It is used to wrap text and inline elements within DITA content to ensure consistent markup and help avoid mixed markup issues.
The p element serves these primary purposes:
-
Structuring text content in DITA for consistent markup
-
Ensuring proper content organization and preventing mixed content issues
Key characteristics of the p element:
-
Is a block element that contains text and inline elements
-
Should not contain other block elements (such as
figureornote)
Content within the p element typically follows these output formatting rules:
-
Typically starts from a new line in outputs
-
Usually displayed with standard paragraph spacing
-
Maintains consistent whitespace handling across different output formats
-
Preserves text flow direction according to language requirements
-
May include inline formatting such as emphasis, monospace, or links
-
Can be styled differently based on its context (for example, paragraphs in notes vs. regular content)
Use p to:
-
Wrap all text content in block contexts like list items (
li), table entries (entry), and notes (note) -
Express a single, cohesive idea or point within a larger topic
-
Break down complex information within a topic into sequential, readable segments
-
Maintain consistent spacing and formatting in various output formats
Avoid mixed markup
Mixed markup occurs when text appears alongside block elements within the same parent element. This can cause:
-
Inconsistent output rendering
-
Localization problems
Example of problematic mixed markup:
<li>Content added directly in a list item.
<p>Content added in a paragraph within a list item.</p>
</li>
Example of correct markup:
<li><p>This content is added in a paragraph.</p>
<p>So it this; there is no content added directly in the lit item element.</p>
</li>
The p element added to a concept topic in the Heretto CCMS Content Editor.
The DITA source of the p element with the surrounding context of a concept:
<concept id="concept-4948" xml:lang="en-us">
<title>Coffee Brewing Fundamentals</title>
<shortdesc>Understanding the key variables that affect coffee extraction and flavor development to achieve consistently exceptional coffee brewing results.</shortdesc>
<prolog>
<author translate="no" type="creator">Heretto User<user@heretto.com></author>
</prolog>
<conbody>
<p>Successful coffee brewing depends on controlling several critical variables. The interplay between water quality, temperature, grind size, and brewing time determines the final cup quality and flavor profile. Understanding and mastering these variables enables you to consistently produce coffee that highlights the bean's inherent characteristics while avoiding common extraction problems.</p>
<section>
<title>Water Quality</title>
<p>Water composition significantly affects extraction, comprising 98-99% of brewed coffee. The right mineral content and chemical composition are crucial for optimal extraction and flavor development:</p>
<ul>
<li>
<p>Mineral content (TDS): Ideal range is 150-200 ppm (parts per million). Water that is too soft (below 100 ppm) results in under-extraction and flat flavors, while extremely hard water (above 250 ppm) can lead to bitter flavors and scale buildup in equipment. Calcium and magnesium ions are particularly important.</p>
</li>
<li>
<p>(...)</p>
</li>
</ul>
<note type="tip">Test your water hardness with a TDS meter and pH strips regularly. Consider seasonal variations in municipal water supply that may affect mineral content.</note>
</section>
<section>
<title>Temperature Control</title>
<p>Proper temperature management ensures optimal extraction and significantly impacts which compounds are extracted from the coffee grounds:</p>
<ul>
<li>
<p>Brewing temperature range: 195-205°F (90.5-96.1°C). This range effectively extracts desirable compounds while avoiding bitter over-extraction.</p>
</li>
<li>
<p>(...)</p>
</li>
</ul>
<note type="tip">Use a temperature-controlled kettle for best results. For manual kettles, wait 30-45 seconds after boiling before pouring, or until steam becomes less vigorous.</note>
</section>
</conbody>
</concept>