Skip to content

Attributes

Attributes for schema are the attributes that are associated with each schema. They are objects with properties that tell markdoc what attributes are allowed in a specific tag for each schema and what to do after that. A custom attribute is a class that manipulates the value of an attribute.

TIP

If you want to see the custom attributes click here

style

keyvalue
typeAn attribute that validates based on an object if so it will transform into a string.
requiredfalse

INFO

The transformed string will be lowercased with a : at the end of the key and a ; at the end of the value.

This written code

md
{% div style={fontSize:30px} %}
    Text here
{% /div  %}

Will transform into this

html
<div style="font-size:30px;">
    Text here
</div>

target

keyvalue
typeString
matches_target,_blank,_parent,_top
requiredfalse

tabindex

keyvalue
typeIntegerAttribute
requiredfalse

hidden

keyvalue
typeBoolean
requiredfalse

refferpolicy

keyvalue
requiredfalse
typeString
matchesno-referrer no-referrer-when-downgrade origin origin-when-cross-origin same-origin strict-origin-when-cross-origin unsafe-url

title

keyvalue
typeAn attribute that validates the value if it's a proper sentence
requiredfalse

width

keyvalue
typeIntegerAttribute
requiredfalse

height

keyvalue
typeIntegerAttribute
requiredfalse

cite

keyvalue
typeSourceAttribute
requiredfalse

datetime

keyvalue
typeAn attribute that validates the value if it's a viable date string
requiredfalse

translate

keyvalue
typeString
matchesyes,no
defaultyes

lang

keyvalue
typeString
matchesaz-Arab ba bal ban bar bas bax bbc bbj be,bej bem bew bez bfd bfq bg bgn bho bi bik bin bjn bkm bla bm bn bo bpy bqi br bra brh brx bs bss bua bug bum byn byv ca cad car cay cch ccp ce ceb cgg ch chb chg chk chm chn cho chp chr chy ckb co cop cps cr crh crs cs csb cu cv cy da dak dar dav de del den dgr din dje doi dsb dtp dua dum dv dyo dyu dz dzg ebu ee efi egl egy eka el elx en en-AU en-CA en-GB en-US enm eo es es-419 es-AR es-CL es-CO es-CR es-EC es-ES es-GT es-HN es-MX es-NI es-PA es-PE es-PR es-PY es-SV es-US es-UY es-VE et eu ewo ext fa fa-AF ff ff-Adlm ff-Latn fi fil fit fj fo fon fr fr-CA fr-CH frc frm fro frp frr frs fur fy ga gaa gag gan gay gba gbz gd gez gil gl glk gmh
defaulten

dir

keyvalue
typeString
matchesauto,ltr,rtl
defaultauto

draggable

keyvalue
typeString
requiredfalse

spellcheck

keyvalue
typeString
requiredfalse

contenteditable

keyvalue
typeString
requiredfalse

Released under the MIT License