Comentários: separadores com no máximo "---"
Trechos com quatro ou mais hífens dentro de comentários viram "---" (strings não mudam). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
374b445a8f
commit
80bd330766
40 files changed
+137
-137
No files matched your search
@@ -10,7 +10,7 @@
|
||||
|
||||
TB_API const TinyBlocks_LibraryDescriptor* tb_markdown_get_library(void);
|
||||
|
||||
/* -- API C (resultados com malloc; libere com free) ---------------------- */
|
||||
/* -- API C (resultados com malloc; libere com free) --- */
|
||||
TB_API char* tb_markdown_to_html(const char* md);
|
||||
TB_API char* tb_markdown_to_xml(const char* md);
|
||||
TB_API char* tb_markdown_to_svg(const char* md);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
static char s_err[160] = "";
|
||||
const char* tb_markdown_last_error(void) { return s_err; }
|
||||
|
||||
/* ---------------------------------------------------------------- Buffer */
|
||||
/* --- Buffer */
|
||||
typedef struct { char* p; size_t n, cap; } Buf;
|
||||
static bool b_res(Buf* b, size_t extra) {
|
||||
if (b->n + extra + 1 <= b->cap) return true;
|
||||
@@ -49,7 +49,7 @@ static void b_esc(Buf* b, const char* s, size_t n) {
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- Blocos */
|
||||
/* --- Blocos */
|
||||
typedef enum { BLK_H, BLK_P, BLK_LI, BLK_CODE, BLK_QUOTE, BLK_HR } BlkKind;
|
||||
typedef struct {
|
||||
BlkKind kind;
|
||||
@@ -208,7 +208,7 @@ static Doc* parse(const char* md) {
|
||||
return d;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- Inline */
|
||||
/* --- Inline */
|
||||
/* Serializa inline markdown para HTML (xml=false) ou XML (xml=true). */
|
||||
static void inline_out(Buf* b, const char* s, bool xml) {
|
||||
const char* bold0 = xml ? "<bold>" : "<strong>";
|
||||
@@ -276,7 +276,7 @@ static void inline_out(Buf* b, const char* s, bool xml) {
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ HTML */
|
||||
/* --- HTML */
|
||||
char* tb_markdown_to_html(const char* md) {
|
||||
s_err[0] = 0;
|
||||
Doc* d = parse(md);
|
||||
@@ -320,7 +320,7 @@ char* tb_markdown_to_html(const char* md) {
|
||||
return b.p;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------- XML */
|
||||
/* --- XML */
|
||||
char* tb_markdown_to_xml(const char* md) {
|
||||
s_err[0] = 0;
|
||||
Doc* d = parse(md);
|
||||
@@ -367,7 +367,7 @@ char* tb_markdown_to_xml(const char* md) {
|
||||
return b.p;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------- SVG */
|
||||
/* --- SVG */
|
||||
char* tb_markdown_to_svg_opts(const char* md, int width, int font_size) {
|
||||
s_err[0] = 0;
|
||||
if (width < 80) width = 640;
|
||||
@@ -470,7 +470,7 @@ char* tb_markdown_to_svg_opts(const char* md, int width, int font_size) {
|
||||
|
||||
char* tb_markdown_to_svg(const char* md) { return tb_markdown_to_svg_opts(md, 640, 16); }
|
||||
|
||||
/* ---------------------------------------------------------------- Blocos */
|
||||
/* --- Blocos */
|
||||
static void eval_html(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
char* s = tb_markdown_to_html(tb_block_input_text(self, rt, 0));
|
||||
tb_block_set_output(self, 0, tb_value_text(s ? s : "")); free(s); self->dirty = false;
|
||||
|
||||
Reference in new issue
Block a user