Files
news.gitea.happylizard.me/bin/gems/rouge-4.5.1/lib/rouge/lexers/tsx.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

34 lines
639 B
Ruby

# -*- coding: utf-8 -*- #
# frozen_string_literal: true
module Rouge
module Lexers
load_lexer 'jsx.rb'
load_lexer 'typescript/common.rb'
class TSX < JSX
extend TypescriptCommon
title 'TSX'
desc 'TypeScript-compatible JSX (www.typescriptlang.org/docs/handbook/jsx.html)'
tag 'tsx'
filenames '*.tsx'
prepend :element_name do
rule %r/(\w+)(,)/ do
groups Name::Other, Punctuation
pop! 3
end
rule %r/</, Punctuation, :type
end
state :type do
mixin :object
rule %r/>/, Punctuation, :pop!
end
end
end
end