The Hubzilla
|
Some functions for BB conversions for Diaspora protocol. More...
Functions | |
markdown_to_bb ($s, $use_zrl=false, $options=[]) | |
Convert Markdown to bbcode. More... | |
bb_to_markdown_share ($match) | |
bb_to_markdown ($Text, $options=[]) | |
Convert bbcode to Markdown. More... | |
html2markdown ($html) | |
Convert a HTML text into Markdown. More... | |
Some functions for BB conversions for Diaspora protocol.
bb_to_markdown | ( | $Text, | |
$options = [] |
|||
) |
Convert bbcode to Markdown.
string | $Text | The message as bbcode |
array | $options | default empty |
bb_to_markdown_share | ( | $match | ) |
array | $match |
html2markdown | ( | $html | ) |
Convert a HTML text into Markdown.
This function uses the library league/html-to-markdown for this task.
If the HTML text can not get parsed it will return an empty string.
string | $html | The HTML code to convert |
Referenced by bb_to_markdown().
markdown_to_bb | ( | $s, | |
$use_zrl = false , |
|||
$options = [] |
|||
) |
Convert Markdown to bbcode.
We don't want to support a bbcode specific markdown interpreter and the markdown library we have is pretty good, but provides HTML output. So we'll use that to convert to HTML, then convert the HTML back to bbcode, and then clean up a few Diaspora specific constructs.
string | $s | The message as Markdown |
boolean | $use_zrl | default false |
array | $options | default empty |
Referenced by Zotlabs\Module\Item\post().