You are reading a single comment by @EagleEyez and its replies. Click here to read the full conversation.
  • I'm possibly in the wrong thread.... but I'm desperately looking for a list of the various text formatting options available esp. underscore, strikethrough.... I couldn't see any pinned post anywhere.
    (Please forgive the non-techy pleb.)
    And yes, I did make use of the search function.
    TIA

  • IF IN DOUBT, USE MARKDOWN: https://www.markdownguide.org/cheat-sheet/

    You have three types of formatting available:

    1. A subset of BBCode
    2. Markdown
    3. A subset of HTML

    Those are applied in that order to produce HTML (we convert the BBCode to Markdown, then convert the Markdown to HTML), and the final output is then sanitised to remove HTML that can be used maliciously (i.e. to obtain someone else's cookies or session).

    The BBCode we support:

        b
        u
        i
        s
        color
        list
        *
        img
        attach
        url
        email
        cite
    

    The final accepted list of HTML is captured within the user generated content policy, where anything not matching the following HTML is removed from the post:

    Attributes:
        # global attributes
        dir on everything
        lang on everything
        id on everything
        title on everything
    
        # sectioning and grouping
        open on details
        cite on blockquote
    
        # links
        href on a
        name on map
        alt on area
        href on area
    
        # forms
        cite on q
        datetime on time
        value on meter
        min on meter
        max on meter
        low on meter
        high on meter
        optimum on meter
        value on progress
        max on progress
    
        # lists
        type on ol
        type on ul
        type on li
        value on li
    
        # tables
        height on table
        width on table
        summary on table
        align on col
        align on colgroup
        height on col
        height on colgroup
        width on col
        width on colgroup
        span on col
        span on colgroup
        valign on col
        valign on colgroup
        align on thead
        align on tr
        valign on thead
        valign on tr
        abbr on td
        abbr on th
        align on td
        align on th
        colspan on td
        colspan on th
        rowspan on td
        rowspan on th
        headers on td
        headers on th
        height on td
        height on th
        scope on td
        scope on th
        valign on td
        valign on th
        nowrap on td
        nowrap on th
        align on tbody
        align on tfoot
        valign on tbody
        valign on tfoot
    
        # images
        coords on area
        rel on area
        shape on area
        usemap on img
        align on img
        alt on img
        height on img
        width on img
        src on img
    
    URLs
        # these are the values of links, i.e. standard web links
        mailto:
        http://
        http://
    
    Elements
        # sectioning
        article
        aside
        details
        figure
        section
        summary
    
        # headers
        h1
        h2
        h3
        h4
        h5
        h6
        hgroup
    
        # content grouping and separating
        blockquote
        br
        div
        hr
        p 
        span
        wbr
    
        # links
        a
        map
        area
        img
    
        # phrase
        abbr
        acronym
        cite
        code
        dfn
        em
        figcaption
        mark
        s
        samp
        strong
        sub
        sup
        var
        q
        time
    
       # styles
        b
        i
        pre
        small
        strike
        tt
        u
    
        # language
        bdi
        bdo
        rp
        rt
        ruby
    
        # change tracking
        del
        ins
    
        # lists
        ol
        ul
        li
        dl
        dt
        dd
    
        # forms
        meter
    
        # tables
        table
        thead
        tr
        th
        tbody
        td
        tfoot
        caption
    

    Additionally we add nofollow as a rel on all fully qualified links, and we will also add _blank as a target on fully qualified links. HTML entities are also escaped, the output is pure HTML and nothing ambiguous will remain.

    Finally, any comment entirely made of capital letters (according to a lack of unicode.IsLower() rune being present) will be run (in it's totality) through unicode.ToLower()... which means anyone SHOUTING will have their post converted to shouting.

    Essentially... you almost do not need to worry about it, we support multiple types of formatting and way more than you imagine, and it's very comprehensive so even if you're cutting and pasting in rich content from elsewhere it mostly works.

    Notable omissions though, we do not support anything not explicitly mentioned above, but specifically we have not mentioned:

        link
        script
        style
        object
        embed
    

    But we will recognise links to some places (like YouTube) and convert those into embeds for you. We cannot take their HTML as input as it would mean disabling security features, but we can produce their HTML from a link.

About

Avatar for EagleEyez @EagleEyez started