User Rating 0.0
Total Usage 0 times
0 characters
0 characters
Quick Presets:
Is this tool helpful?

Your feedback helps us improve.

About

Textile is a lightweight markup language used by platforms like Redmine, Textpattern, and legacy CMS installations. Manual conversion from HTML to Textile is error-prone: a misplaced pipe character breaks table rendering, an unclosed block modifier corrupts downstream formatting, and nested list indentation follows strict whitespace rules that differ from HTML's recursive ul/ol nesting. This converter parses your HTML into a DOM tree using the browser's native DOMParser, then performs a recursive depth-first traversal to emit correct Textile syntax for every supported element. It handles block constructs (headings h1 - h6, paragraphs, blockquotes, preformatted blocks, horizontal rules, ordered and unordered lists, and tables with header rows) and inline constructs (bold, italic, deleted, inserted, superscript, subscript, inline code, links, and images). Note: this tool approximates CSS style attributes where possible (e.g., text-align and color on block elements) but cannot replicate arbitrary CSS in Textile's limited style syntax. Deeply nested or malformed HTML may produce imperfect output requiring manual review.

html to textile textile converter redmine textile markup converter html converter textile format html markup

Formulas

The conversion algorithm performs a depth-first recursive traversal of the parsed DOM tree. For each node, the logic follows:

{
emit(textContent) if nodeTEXT_NODEblockMap(tag) + recurse(children) if tag {h1h6, p, bq, pre}inlineWrap(marker, recurse(children)) if tag {strong, em, code…}listItem(depth, marker) if tag = litableRow(cells) if tag = trrecurse(children) otherwise

Where depth tracks nesting level for lists (each level adds one * or # prefix character). The blockMap function prepends the Textile block modifier (e.g., h2. ) and appends a trailing blank line. The inlineWrap function surrounds recursed child content with the appropriate Textile delimiter pair (e.g., ** for bold). Whitespace normalization collapses runs of >2 consecutive newlines into exactly 2.

Reference Data

HTML ElementTextile SyntaxExample OutputNotes
<h1> - <h6>h1. - h6.h1. HeadingBlock-level, followed by blank line
<p>p. (or plain text)p. Paragraph textEmitted as plain text when no attributes
<strong> / <b>*text**bold*Inline bold marker
<em> / <i>_text__italic_Inline emphasis marker
<del> / <s>-text--deleted-Strikethrough
<ins>+text++inserted+Underline / inserted text
<sup>^text^^superscript^Superscript
<sub>~text~~subscript~Subscript
<code>@text@@inline code@Inline code
<pre>bc. or <pre>bc. code blockBlock code, preserves whitespace
<blockquote>bq.bq. quoted textBlock quotation
<a href>"text":url"link":http://example.comAnchor with href
<img src>!url!!image.png!Alt text: !url(alt)!
<ul> / <li>* item* itemNested: ** sub-item
<ol> / <li># item# itemNested: ## sub-item
<table>|cell|cell||data|data|Rows separated by newlines
<th>|_. header||_. Name|_. Value|Header cell prefix
<hr>------Horizontal rule
<br>\nLine breakNewline character in output
<span> with style%{style}text%%{color:red}text%Inline style span
<cite>??text????citation??Citation marker
<acronym> / <abbr>ABC(Full Name)HTML(HyperText Markup Language)With title attribute

Frequently Asked Questions

The algorithm tracks list nesting depth and list type (ordered vs. unordered) independently at each level. A <ul> inside an <ol> produces items prefixed with #* (ordered parent, unordered child). Depth increments each time a new <ul> or <ol> is entered, and the correct marker character is pushed onto a stack. Maximum tested depth is 6 levels, matching Textile's practical limit in Redmine.
Textile supports a limited style syntax via curly braces. For block elements like <p style="text-align:center">, the converter emits p=. (Textile's center alignment shorthand). For inline <span> elements with a style attribute, it wraps content in %{style}content%. Only color, text-align, font-weight, and font-style properties produce meaningful Textile output. Complex CSS (flexbox, grid, transforms) is silently dropped.
Yes. The DOMParser decodes all HTML entities (&, <, , etc.) into their Unicode equivalents during parsing. The output Textile contains the actual characters. If you need entities preserved as literal strings in Textile, you must escape them manually after conversion.
Textile supports \2 (colspan of 2) and /2 (rowspan of 2) prefixes inside table cells. The converter reads colspan and rowspan attributes from <td> and <th> elements and emits the correct Textile notation. However, Textile's table model is simpler than HTML's. Tables with irregular spans that don't form a clean grid may require manual adjustment.
The browser's native DOMParser is tolerant of malformed HTML. It auto-closes unclosed tags, fixes nesting errors, and constructs a valid DOM tree. The converter then walks this corrected tree. This means the Textile output reflects the browser's interpretation of your HTML, which may differ from your intent if the source markup has errors. For best results, validate your HTML before conversion.
Redmine uses a subset of Textile (via the RedCloth library in Ruby). Standard Textile features like footnotes (fn1.), definition lists, and some extended block modifiers may not render in Redmine. This converter targets the common subset: headings, paragraphs, bold, italic, links, images, lists, tables, blockquotes, and preformatted blocks. These elements are safe across Redmine, Textpattern, and other Textile implementations.