<commit_before>/* markdown: a C implementation of <NAME>'s Markdown markup language.
 *
 * Copyright (C) 2007 <NAME>.
 * The redistribution terms are provided in the COPYRIGHT file that must
 * be distributed with this source code.
 */
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>

#include "config.h"

#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"

/* block-level tags for passing html blocks through the blender
 */
struct kw {
    char *id;
    int  size;
    int  selfclose;
} ;

#define KW(x)	{ x, sizeof(x)-1, 0 }
#define SC(x)	{ x, sizeof(x)-1, 1 }

static struct kw blocktags[] = { KW("!--"), KW("STYLE"), KW("SCRIPT"),
				 KW("ADDRESS"), KW("BDO"), KW("BLOCKQUOTE"),
				 KW("CENTER"), KW("DFN"), KW("DIV"), KW("H1"),
				 KW("H2"), KW("H3"), KW("H4"), KW("H5"),
				 KW("H6"), KW("LISTING"), KW("NOBR"),
				 KW("UL"), KW("P"), KW("OL"), KW("DL"),
				 KW("PLAINTEXT"), KW("PRE"), KW("TABLE"),
				 KW("WBR"), KW("XMP"), SC("HR"), SC("BR"),
				 KW("IFRAME"), KW("MAP") };
#define SZTAGS	(sizeof blocktags / sizeof blocktags[0])
#define MAXTAG	11 /* sizeof "BLOCKQUOTE" */

typedef int (*stfu)(const void*,const void*);

typedef ANCHOR(Paragraph) ParagraphRoot;


/* case insensitive string sort (for qsort() and bsearch() of block tags)
 */
static int
casort(struct kw *a, struct kw *b)
{
    if ( a->size != b->size )<commit_msg>Support new HTML5 block-level elements.<commit_after>/* markdown: a C implementation of <NAME>'s Markdown markup language.
 *
 * Copyright (C) 2007 <NAME>.
 * The redistribution terms are provided in the COPYRIGHT file that must
 * be distributed with this source code.
 */
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>

#include "config.h"

#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"

/* block-level tags for passing html blocks through the blender
 */
struct kw {
    char *id;
    int  size;
    int  selfclose;
} ;

#define KW(x)	{ x, sizeof(x)-1, 0 }
#define SC(x)	{ x, sizeof(x)-1, 1 }

static struct kw blocktags[] = { KW("!--"), KW("STYLE"), KW("SCRIPT"),
				 KW("ADDRESS"), KW("BDO"), KW("BLOCKQUOTE"),
				 KW("CENTER"), KW("DFN"), KW("DIV"), KW("H1"),
				 KW("H2"), KW("H3"), KW("H4"), KW("H5"),
				 KW("H6"), KW("LISTING"), KW("NOBR"),
				 KW("UL"), KW("P"), KW("OL"), KW("DL"),
				 KW("PLAINTEXT"), KW("PRE"), KW("TABLE"),
				 KW("WBR"), KW("XMP"), SC("HR"), SC("BR"),
				 KW("IFRAME"), KW("MAP"), KW("ARTICLE"),
				 KW("ASIDE"), KW("FOOTER"), KW("HEADER"),
				 KW("HGROUP"), KW("NAV"), KW("SECTION") };
#define SZTAGS	(sizeof blocktags / sizeof blocktags[0])
#define MAXTAG	11 /* sizeof "BLOCKQUOTE" */

typedef int (*stfu)(const void*,const void*);

typedef ANCHOR(Paragraph) ParagraphRoot;


/* case insensitive string sort (for qsort() and bsearch() of block tags)
 */
static int
casort(struct kw *a, struct kw *b)
{
    if ( a->size != b->size )
{'fraction_non_alphanumeric': 0.21342685370741482, 'fraction_numerical': 0.01169004676018704, 'mean_word_length': 4.110921501706485, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1301007', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1116, 'n_words': 317}