Fossil

Check-in [2077ffe660]
Login

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

Overview
Comment:A triple grave accent quoted text (```....```) in markdown is rendered as <pre>...</pre>.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2077ffe660ec2bcd6cfa5f241b55a9bab8f7eb6f2e2921c8a6fa6b85603e1a1a
User & Date: drh 2019-08-08 20:35:09.164
Original Comment: A triple grave accent quoted text (```....```) is rendered inside of <pre>...</pre>.
Context
2019-08-08
22:26
Further refine the fenced code block rendering in markdown to try to comply with the CommonMark spec. check-in: 81caad6ce6 user: drh tags: trunk
20:35
A triple grave accent quoted text (```....```) in markdown is rendered as <pre>...</pre>. check-in: 2077ffe660 user: drh tags: trunk
05:55
Moved the comment about learning from Git's design mistakes to a place higher up in the document where it makes more sense. It was almost a non sequitur where it was before. check-in: 0e0d76ee27 user: wyoung tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/markdown.c.
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
              void *opaque);
  void (*table_row)(struct Blob *ob, struct Blob *cells, int flags,
              void *opaque);

  /* span level callbacks - NULL or return 0 prints the span verbatim */
  int (*autolink)(struct Blob *ob, struct Blob *link,
          enum mkd_autolink type, void *opaque);
  int (*codespan)(struct Blob *ob, struct Blob *text, void *opaque);
  int (*double_emphasis)(struct Blob *ob, struct Blob *text,
            char c, void *opaque);
  int (*emphasis)(struct Blob *ob, struct Blob *text, char c,void*opaque);
  int (*image)(struct Blob *ob, struct Blob *link, struct Blob *title,
            struct Blob *alt, void *opaque);
  int (*linebreak)(struct Blob *ob, void *opaque);
  int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title,







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
              void *opaque);
  void (*table_row)(struct Blob *ob, struct Blob *cells, int flags,
              void *opaque);

  /* span level callbacks - NULL or return 0 prints the span verbatim */
  int (*autolink)(struct Blob *ob, struct Blob *link,
          enum mkd_autolink type, void *opaque);
  int (*codespan)(struct Blob *ob, struct Blob *text, int nSep, void *opaque);
  int (*double_emphasis)(struct Blob *ob, struct Blob *text,
            char c, void *opaque);
  int (*emphasis)(struct Blob *ob, struct Blob *text, char c,void*opaque);
  int (*image)(struct Blob *ob, struct Blob *link, struct Blob *title,
            struct Blob *alt, void *opaque);
  int (*linebreak)(struct Blob *ob, void *opaque);
  int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title,
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
  f_end = end-nb;
  while( f_end>nb && (data[f_end-1]==' ' || data[f_end-1]=='\t') ){ f_end--; }

  /* real code span */
  if( f_begin<f_end ){
    struct Blob work = BLOB_INITIALIZER;
    blob_init(&work, data+f_begin, f_end-f_begin);
    if( !rndr->make.codespan(ob, &work, rndr->make.opaque) ) end = 0;
  }else{
    if( !rndr->make.codespan(ob, 0, rndr->make.opaque) ) end = 0;
  }
  return end;
}


/* char_escape -- '\\' backslash escape */
static size_t char_escape(







|

|







746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
  f_end = end-nb;
  while( f_end>nb && (data[f_end-1]==' ' || data[f_end-1]=='\t') ){ f_end--; }

  /* real code span */
  if( f_begin<f_end ){
    struct Blob work = BLOB_INITIALIZER;
    blob_init(&work, data+f_begin, f_end-f_begin);
    if( !rndr->make.codespan(ob, &work, nb, rndr->make.opaque) ) end = 0;
  }else{
    if( !rndr->make.codespan(ob, 0, nb, rndr->make.opaque) ) end = 0;
  }
  return end;
}


/* char_escape -- '\\' backslash escape */
static size_t char_escape(
Changes to src/markdown_html.c.
323
324
325
326
327
328
329
330





331
332
333
334
335
336
337
338
339
340
341
  }else{
    html_escape(ob, blob_buffer(link), blob_size(link));
  }
  BLOB_APPEND_LITERAL(ob, "</a>");
  return 1;
}

static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){





  if( text ){
    BLOB_APPEND_LITERAL(ob, "<code>");
    html_escape(ob, blob_buffer(text), blob_size(text));
    BLOB_APPEND_LITERAL(ob, "</code>");
  }
  return 1;
}

static int html_double_emphasis(
  struct Blob *ob,
  struct Blob *text,







|
>
>
>
>
>

|

|







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
  }else{
    html_escape(ob, blob_buffer(link), blob_size(link));
  }
  BLOB_APPEND_LITERAL(ob, "</a>");
  return 1;
}

static int html_code_span(
  struct Blob *ob,
  struct Blob *text,  /* The stuff in between the code span marks */
  int nSep,           /* Number of grave accents marks as delimiters */
  void *opaque
){
  if( text ){
    blob_append(ob, nSep>=3 ? "<pre>" : "<code>", -1);
    html_escape(ob, blob_buffer(text), blob_size(text));
    blob_append(ob, nSep>=3 ? "</pre>" : "</code>", -1);
  }
  return 1;
}

static int html_double_emphasis(
  struct Blob *ob,
  struct Blob *text,