Fossil

Check-in [e382cae5]
Login

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

Overview
Comment:The markdown processor should use the Fossil memory allocation routines.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e382cae5c104ccc586d3a2bff3c59670948eb3e8242bb8973c09f8bb1da5d87a
User & Date: mistachkin 2018-03-20 17:08:11.733
Context
2018-03-20
17:10
Support for using 'sys/mman.h' when compiling for POSIX. ... (check-in: d5ca5384 user: mistachkin tags: trunk)
17:08
The markdown processor should use the Fossil memory allocation routines. ... (check-in: e382cae5 user: mistachkin tags: trunk)
2018-03-19
20:24
If the dp= and r= query parameters are both supplied to /timeline, use only the r= query parameter and ignore dp=. ... (check-in: 7c690c08 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/markdown.c.
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
    /* render the header row */
    head = new_work_buffer(rndr);
    if( head ){
      parse_table_row(head, rndr, data, head_end, 0, 0, MKD_CELL_HEAD);
    }

    /* parse alignments if provided */
    if( col && (aligns=malloc(align_size * sizeof *aligns))!=0 ){
      for(i=0; i<align_size; i++) aligns[i] = 0;
      col = 0;
      i = head_end+1;

      /* skip initial white space and optional separator */
      while( i<size && (data[i]==' ' || data[i]=='\t') ){ i++; }
      if( data[i]=='|' ) i++;







|







1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
    /* render the header row */
    head = new_work_buffer(rndr);
    if( head ){
      parse_table_row(head, rndr, data, head_end, 0, 0, MKD_CELL_HEAD);
    }

    /* parse alignments if provided */
    if( col && (aligns=fossil_malloc(align_size * sizeof *aligns))!=0 ){
      for(i=0; i<align_size; i++) aligns[i] = 0;
      col = 0;
      i = head_end+1;

      /* skip initial white space and optional separator */
      while( i<size && (data[i]==' ' || data[i]=='\t') ){ i++; }
      if( data[i]=='|' ) i++;
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980

  /* render the full table */
  rndr->make.table(ob, head, rows, rndr->make.opaque);

  /* cleanup */
  if( head ) release_work_buffer(rndr, head);
  if( rows!=&fallback ) release_work_buffer(rndr, rows);
  free(aligns);
  return i;
}


/* parse_block -- parsing of one block, returning next char to parse */
static void parse_block(
  struct Blob *ob,        /* output blob */







|







1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980

  /* render the full table */
  rndr->make.table(ob, head, rows, rndr->make.opaque);

  /* cleanup */
  if( head ) release_work_buffer(rndr, head);
  if( rows!=&fallback ) release_work_buffer(rndr, rows);
  fossil_free(aligns);
  return i;
}


/* parse_block -- parsing of one block, returning next char to parse */
static void parse_block(
  struct Blob *ob,        /* output blob */