Remove hard line breaks from AsciiDoc files for DITA compatibility. Use this skill when asked to fix line breaks, remove forced breaks, or prepare files for DITA conversion.
Remove hard line breaks from AsciiDoc files for DITA compatibility.
This skill uses the line_break.rb Ruby script to find and remove hard line breaks that are not supported in DITA. Hard line breaks in AsciiDoc can be created using:
+ at the end of a line ( +):hardbreaks-option: document attribute%hardbreaks option on blocksoptions=hardbreaks attributeBefore:
This is the first line +
and this continues on a new line.
After:
This is the first line and this continues on a new line.
Before:
:hardbreaks-option:
This text has
forced line breaks
everywhere.
After:
This text has forced line breaks everywhere.
Before:
[%hardbreaks]
First line
Second line
Third line
After:
First line
Second line
Third line
Hard line breaks cannot be mapped to DITA output. The AsciiDocDITA Vale rule LineBreak.yml warns:
Hard line breaks are not supported in DITA.
When the user asks to fix line breaks:
.adoc files in the target locationruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb <file>
To preview changes without modifying files:
ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb <file> --dry-run
ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb <file> -o <output.adoc>
find <folder> -name "*.adoc" -exec ruby ${CLAUDE_SKILL_DIR}/scripts/line_break.rb {} \;
+ line continuations" + at end of line, the following line is joined with a space:hardbreaks-option: attribute line is removed entirely%hardbreaks option is removed from block attribute lists<file>: Removed N hard line break(s)
Or:
<file>: No hard line breaks found
The Ruby script is located at: ${CLAUDE_SKILL_DIR}/scripts/line_break.rb
This skill addresses the warning from: .vale/styles/AsciiDocDITA/LineBreak.yml