Skip to content

Comments

Fix new line not shown in html citation#753

Merged
shinyichen merged 1 commit intoadsabs:masterfrom
shinyichen:citation-format-fix
Jan 12, 2026
Merged

Fix new line not shown in html citation#753
shinyichen merged 1 commit intoadsabs:masterfrom
shinyichen:citation-format-fix

Conversation

@shinyichen
Copy link
Member

@shinyichen shinyichen commented Jan 6, 2026

Citation in HTML format uses \n as new line, and should be converted to html tag <br/> to be rendered correctly.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.8%. Comparing base (6445db0) to head (4d82fb2).

Files with missing lines Patch % Lines
...ponents/CitationExporter/components/ResultArea.tsx 33.4% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #753     +/-   ##
========================================
+ Coverage    71.6%   71.8%   +0.3%     
========================================
  Files         218     217      -1     
  Lines       24584   24480    -104     
  Branches     1402    1403      +1     
========================================
- Hits        17582   17564     -18     
+ Misses       6970    6884     -86     
  Partials       32      32             
Files with missing lines Coverage Δ
...ponents/CitationExporter/components/ResultArea.tsx 59.6% <33.4%> (-1.0%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@thostetler thostetler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- small suggestion to make it a little more complete when handling the new lines

Comment on lines +14 to +17
const replaceNewLineWithHtml = (html: string) => {
return html.replaceAll('\n', '<br/>');
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const replaceNewLineWithHtml = (html: string) => {
return html.replaceAll('\n', '<br/>');
};
const replaceNewLineWithHtml = (html: string) => {
return html?.replace(/\r\n|\r|\n/g, '<br/>');
};

Just to be more complete. In case there were windows style line-endings

@shinyichen shinyichen merged commit 1fd9440 into adsabs:master Jan 12, 2026
5 checks passed
@shinyichen shinyichen deleted the citation-format-fix branch January 12, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants