;============================================================
; iron_markdown.hsp — 簡易 Markdown → HTML 変換
; 外部 DLL 不要。基本的な Markdown 構文をサポート。
;============================================================
#ifndef __iron_markdown_hsp__
#define __iron_markdown_hsp__
#module iron_markdown
#deffunc md_to_html str md, local lines, local html, local line, local i
notesel md
html = ""
repeat notemax
noteget line, cnt
; 見出し
if strmid(line,0,3) == "###" { html += "
" + strmid(line,4,999) + "
\n" : continue }
if strmid(line,0,2) == "##" { html += "" + strmid(line,3,999) + "
\n" : continue }
if strmid(line,0,1) == "#" { html += "" + strmid(line,2,999) + "
\n" : continue }
; 箇条書き
if strmid(line,0,2) == "- " { html += "" + strmid(line,2,999) + "\n" : continue }
if strmid(line,0,2) == "* " { html += "" + strmid(line,2,999) + "\n" : continue }
; 水平線
if line == "---" | line == "***" { html += "
\n" : continue }
; 空行 → 段落区切り
if line == "" { html += "
\n" : continue }
; 太字/斜体 (簡易)
strrep line, "**", "", 1
strrep line, "**", "", 1
strrep line, "*", "", 1
strrep line, "*", "", 1
; コード
strrep line, "`", "", 1
strrep line, "`", "", 1
html += "" + line + "
\n"
loop
return html
#global
#endif