<commit_before><?php

namespace Sunlight;

use Sunlight\Util\UrlHelper;

abstract class Bbcode
{
    /**
     * Entry format:
     *
     *      array(
     *           (bool) is pair tag
     *           (bool) has argument
     *           (bool) is nestable
     *           (bool) parse children
     *           (null|int|string) button icon (null = none, 1 = template, string = custom path)
     *      )
     */
    protected static $tags = array(
        'b' => array(true, false, true, true, 1), // bold
        'i' => array(true, false, true, true, 1), // italic
        'u' => array(true, false, true, true, 1), // underline
        'q' => array(true, false, true, true, null), // quote
        's' => array(true, false, true, true, 1), // strike
        'img' => array(true, true, false, false, 1), // image
        'code' => array(true, true, false, true, 1), // code
        'c' => array(true, false, true, true, null), // inline code
        'url' => array(true, true, true, false, 1), // link
        'hr' => array(false, false, false, false, 1), // horizontal rule
        'color' => array(true, true, true, true, null), // color
        'size' => array(true, true, true, true, null), // size
        'noformat' => array(true, false, true, false, null), // no format
    );

    protected static $syntax = array('[', ']', '/', '=', '"');

    protected static $extended = false;

    /**
     * Get known BBCode tags
     *
     * @return array
     */
    static function getTags()
    {
        self::$extended || static::extendTags();
<commit_msg>BBCode - allow [img] tags inside [url]<commit_after><?php

namespace Sunlight;

use Sunlight\Util\UrlHelper;

abstract class Bbcode
{
    /**
     * Entry format:
     *
     *      array(
     *           (bool) is pair tag
     *           (bool) has argument
     *           (bool) is nestable
     *           (bool) parse children
     *           (null|int|string) button icon (null = none, 1 = template, string = custom path)
     *      )
     */
    protected static $tags = array(
        'b' => array(true, false, true, true, 1), // bold
        'i' => array(true, false, true, true, 1), // italic
        'u' => array(true, false, true, true, 1), // underline
        'q' => array(true, false, true, true, null), // quote
        's' => array(true, false, true, true, 1), // strike
        'img' => array(true, true, true, false, 1), // image
        'code' => array(true, true, false, true, 1), // code
        'c' => array(true, false, true, true, null), // inline code
        'url' => array(true, true, true, true, 1), // link
        'hr' => array(false, false, false, false, 1), // horizontal rule
        'color' => array(true, true, true, true, null), // color
        'size' => array(true, true, true, true, null), // size
        'noformat' => array(true, false, true, false, null), // no format
    );

    protected static $syntax = array('[', ']', '/', '=', '"');

    protected static $extended = false;

    /**
     * Get known BBCode tags
     *
     * @return array
     */
    static function getTags()
    {
        self::$extended || static::extendTags();

{'fraction_non_alphanumeric': 0.17199873297434273, 'fraction_numerical': 0.005701615457713019, 'mean_word_length': 2.0076190476190474, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '2191884', 'n_tokens_mistral': 999, 'n_tokens_neox': 970, 'n_words': 307}