Sha256: 16f4f3d19a9ef411ae14664b49d5c02b48e696f2baaf5aa8740357e90c98166e

Contents?: true

Size: 722 Bytes

Versions: 97

Compression:

Stored size: 722 Bytes

Contents

#ifndef CMARK_HTML_H
#define CMARK_HTML_H

#include "buffer.h"
#include "node.h"

CMARK_INLINE
static void cmark_html_render_cr(cmark_strbuf *html) {
  if (html->size && html->ptr[html->size - 1] != '\n')
    cmark_strbuf_putc(html, '\n');
}

#define BUFFER_SIZE 100

CMARK_INLINE 
static void cmark_html_render_sourcepos(cmark_node *node, cmark_strbuf *html, int options) {
  char buffer[BUFFER_SIZE];
  if (CMARK_OPT_SOURCEPOS & options) {
    snprintf(buffer, BUFFER_SIZE, " data-sourcepos=\"%d:%d-%d:%d\"",
             cmark_node_get_start_line(node), cmark_node_get_start_column(node),
             cmark_node_get_end_line(node), cmark_node_get_end_column(node));
    cmark_strbuf_puts(html, buffer);
  }
}


#endif

Version data entries

97 entries across 96 versions & 5 rubygems

Version Path
commonmarker-0.15.0 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.15 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.14 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.13 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.12 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.11 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.9 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.8 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.7 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.6 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.5 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.4 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.3 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.2 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.1 ext/commonmarker/cmark/src/html.h
commonmarker-0.14.0 ext/commonmarker/cmark/src/html.h
commonmarker-0.11.0 ext/commonmarker/cmark/src/html.h