Skip to content

Commit 2de461c

Browse files
committed
Improve raw text presentation
1 parent 4c901a5 commit 2de461c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ GEM
387387
mini_portile2 (~> 2.8.0)
388388
sqlite3 (1.7.3-x86_64-darwin)
389389
sqlite3 (1.7.3-x86_64-linux)
390-
strain-code (0.3.6)
390+
strain-code (0.3.7)
391391
stringio (3.1.7)
392392
thor (1.4.0)
393393
tilt (2.6.1)

app/models/name.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ def corr_name_html
529529
end
530530

531531
def formal_html(assume_valid: false, check_correctness: false)
532-
y = name_html(assume_valid: assume_valid, check_correctness: check_correctness)
532+
y = name_html(
533+
assume_valid: assume_valid, check_correctness: check_correctness
534+
)
533535
y = "“#{y}”" if candidatus?
534536
y += ' <i>corrig.</i>'.html_safe if corrigendum_from?
535537
if not_validly_proposed_in.any?
@@ -552,7 +554,11 @@ def formal_html(assume_valid: false, check_correctness: false)
552554
end
553555

554556
def formal_txt
555-
sanitize(formal_html.gsub(/&#822[01];/, "'"))
557+
sanitize(
558+
formal_html
559+
.gsub(/<sup>([A-Za-z]+)<\/sup>/, '(\\1)')
560+
.gsub(/&#822[01];/, "'")
561+
)
556562
end
557563

558564
def page_description

0 commit comments

Comments
 (0)