Setting the file. One moment.
Subchapter 10.15
references/preset-tagify.mdMarkdown2 KBView on GitHub
Instead of:
<span class="text-red">red text</span>
<div class="flex">flexbox</div>
<span class="i-line-md-emoji-grin"></span>Use tag names directly:
<text-red>red text</text-red>
<flex>flexbox</flex>
<i-line-md-emoji-grin />Works exactly the same!
presetTagify({
prefix: 'un-'
})<!-- Matched -->
<un-flex></un-flex>
<!-- Not matched -->
<flex></flex>Add CSS properties to matched tags:
presetTagify({
// Add display: inline-block to icons
extraProperties: matched => matched.startsWith('i-')
? { display: 'inline-block' }
: {},
})Or apply to all:
presetTagify({
extraProperties: { display: 'block' }
})presetTagify({
// Tag prefix
prefix: '',
// Excluded tags (won't be processed)
excludedTags: ['b', /^h\d+$/, 'table'],
// Extra CSS properties
extraProperties: {},
// Enable default extractor
defaultExtractor: true,
})By default, these tags are excluded:
b (bold)h1 through h6 (headings)tableAdd your own:
presetTagify({
excludedTags: [
'b',
/^h\d+$/,
'table',
'article', // Add custom exclusions
/^my-/, // Exclude tags starting with 'my-'
],
})<i-carbon-sun /><flex-center>, <text-red>