Check-in [8478033670]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Wrap markdown content in an HTML 'div' block of the 'markdown' class.
Timelines: family | ancestors | descendants | both | markdownDivWrapper
Files: files | file ages | folders
SHA1: 8478033670354ecd86ba637178929bafc16ce42b
User & Date: mistachkin 2014-09-22 19:56:28.198
Context
2014-09-26
21:02
Wrap markdown content in an HTML 'div' block of the 'markdown' class. check-in: e061a675e6 user: mistachkin tags: trunk
2014-09-22
19:56
Wrap markdown content in an HTML 'div' block of the 'markdown' class. Closed-Leaf check-in: 8478033670 user: mistachkin tags: markdownDivWrapper
2014-09-21
19:40
typos check-in: b2a4b66f4b user: jan.nijtmans tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/markdown_html.c.
80
81
82
83
84
85
86










87
88
89
90
91
92
93
      i++;
    }
  }
}


/* HTML block tags */











static void html_raw_block(struct Blob *ob, struct Blob *text, void *opaque){
  char *data = blob_buffer(text);
  size_t first = 0, size = blob_size(text);
  INTER_BLOCK(ob);
  while( first<size && data[first]=='\n' ) first++;
  while( size>first && data[size-1]=='\n' ) size--;







>
>
>
>
>
>
>
>
>
>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
      i++;
    }
  }
}


/* HTML block tags */

static void html_prolog(struct Blob *ob, void *opaque){
  INTER_BLOCK(ob);
  BLOB_APPEND_LITTERAL(ob, "<div class=\"markdown\">\n");
}

static void html_epilog(struct Blob *ob, void *opaque){
  INTER_BLOCK(ob);
  BLOB_APPEND_LITTERAL(ob, "</div>\n");
}

static void html_raw_block(struct Blob *ob, struct Blob *text, void *opaque){
  char *data = blob_buffer(text);
  size_t first = 0, size = blob_size(text);
  INTER_BLOCK(ob);
  while( first<size && data[first]=='\n' ) first++;
  while( size>first && data[size-1]=='\n' ) size--;
362
363
364
365
366
367
368
369


370
371
372
373
374
375
376

void markdown_to_html(
  struct Blob *input_markdown,
  struct Blob *output_title,
  struct Blob *output_body
){
  struct mkd_renderer html_renderer = {
    0, 0,  /* no prolog or epilog */



    /* block level elements */
    html_blockcode,
    html_blockquote,
    html_raw_block,
    html_header,
    html_hrule,







|
>
>







372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388

void markdown_to_html(
  struct Blob *input_markdown,
  struct Blob *output_title,
  struct Blob *output_body
){
  struct mkd_renderer html_renderer = {
    /* prolog and epilog */
    html_prolog,
    html_epilog,

    /* block level elements */
    html_blockcode,
    html_blockquote,
    html_raw_block,
    html_header,
    html_hrule,