From 42ec919cd8f0feaf07b34b82ee16d61da1fdf83d Mon Sep 17 00:00:00 2001 From: Gergely Gombos Date: Sun, 1 Dec 2024 20:28:11 +0100 Subject: [PATCH] syntax highlighting --- lib/docs/filters/react/clean_html_react_dev.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/docs/filters/react/clean_html_react_dev.rb b/lib/docs/filters/react/clean_html_react_dev.rb index fb77fa14..dc9dcae1 100644 --- a/lib/docs/filters/react/clean_html_react_dev.rb +++ b/lib/docs/filters/react/clean_html_react_dev.rb @@ -33,6 +33,14 @@ module Docs node.before(node.children).remove end + # Syntax highlighting + css('pre br').each do |node| + node.replace("\n") + end + css('pre').each do |node| + node['data-language'] = 'jsx' + end + doc end end