From 0669c31b52fa6b6be656d812186bb1854d6e123a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E4=91=93=E5=A6=82=E6=B3=95?= Date: Tue, 21 Oct 2025 19:13:00 +0900 Subject: [PATCH 1/3] Add spec to ensure @ in embedded code is not converted to Twitter link --- spec/tdiary/style/gfm_spec.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/spec/tdiary/style/gfm_spec.rb b/spec/tdiary/style/gfm_spec.rb index 067a496..1537242 100644 --- a/spec/tdiary/style/gfm_spec.rb +++ b/spec/tdiary/style/gfm_spec.rb @@ -626,6 +626,32 @@ def class end it { expect(@diary.to_html).to eq @html } end + + describe 'URLs with @ in an embedding codes must not be converted into Twitter links. +' do + before do + source = <<-'EOF' +# subTitle + +This is an embedding of a post of a Mathtodon server. + + + EOF + @diary.append(source) + + @html = <<-'EOF' +
+<%=section_enter_proc( Time.at( 1041346800 ) )%> +

<%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %>

+

This is an embedding of a post of a Mathtodon server.

+ +<%=section_leave_proc( Time.at( 1041346800 ) )%> +
+ EOF + end + it { expect(@diary.to_html).to eq @html } + end + end # Local Variables: From 0897f82e621b545690f85d8b6fb982bb5291fc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E4=91=93=E5=A6=82=E6=B3=95?= Date: Tue, 21 Oct 2025 19:18:50 +0900 Subject: [PATCH 2/3] Update spec/tdiary/style/gfm_spec.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 確かに Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- spec/tdiary/style/gfm_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/tdiary/style/gfm_spec.rb b/spec/tdiary/style/gfm_spec.rb index 1537242..68ad78d 100644 --- a/spec/tdiary/style/gfm_spec.rb +++ b/spec/tdiary/style/gfm_spec.rb @@ -627,7 +627,7 @@ def class it { expect(@diary.to_html).to eq @html } end - describe 'URLs with @ in an embedding codes must not be converted into Twitter links. + describe 'URLs with @ in embedding codes must not be converted into Twitter links. ' do before do source = <<-'EOF' From 91cbc9564261e32e5d323a0a55177d6e55de9454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E4=91=93=E5=A6=82=E6=B3=95?= Date: Fri, 24 Oct 2025 19:47:02 +0900 Subject: [PATCH 3/3] Stash not only pre and code tags but also iframe and script tags --- lib/tdiary/style/gfm.rb | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/tdiary/style/gfm.rb b/lib/tdiary/style/gfm.rb index 023af2a..b211a26 100644 --- a/lib/tdiary/style/gfm.rb +++ b/lib/tdiary/style/gfm.rb @@ -65,7 +65,7 @@ def to_html(string) # 2. Apply markdown conversion r = CommonMarker.render_html(r, [:DEFAULT, :UNSAFE], [:autolink, :table]) - # 3. Stash
 and  tags
+				# 3. Stash 
, ,