Skip to content

Commit

Permalink
Fix font style flip-flopping with raw code (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Jul 10, 2024
1 parent 64b3277 commit 640cc06
Show file tree
Hide file tree
Showing 10 changed files with 344 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fix a bug in font style flip-flopping with raw code ([#67](https://github.com/zepinglee/citeproc-lua/issues/67)).

## [0.5.0] - 2024-06-09

### Added
Expand Down
67 changes: 67 additions & 0 deletions tests/fixtures/local/flipflop_Issue67.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
>>===== MODE =====>>
citation
<<===== MODE =====<<


>>===== DESCRIPTION =====>>
<https://github.com/zepinglee/citeproc-lua/issues/67>
<<===== DESCRIPTION =====<<


>>===== RESULT =====>>
<code>\dots \ </code>dalam Kej.<code>\ </code>8:11 sebagai penanda keterkejutan: “<i>The dove returned to him at sunset, <span style="font-style:normal;">and incredibly</span>, a fresh-picked olive branch was in its mouth!</i>”; lihat Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation
8:11 sebagai penanda keterkejutan: “<i>The dove returned to him at sunset, <span style="font-style:normal;">and incredibly</span>, a fresh-picked olive branch was in its mouth!</i>”; lihat Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation
<<===== RESULT =====<<


>>===== CITATION-ITEMS =====>>
[
[
{
"id": "Hardy2019-Gemsfr",
"prefix": "<code>\\dots \\ </code>dalam Kej.<code>\\ </code>8:11 sebagai penanda keterkejutan: “<i>The dove returned to him at sunset, <i>and incredibly</i>, a fresh-picked olive branch was in its mouth!</i>”; lihat "
}
],
[
{
"id": "Hardy2019-Gemsfr",
"prefix": "8:11 sebagai penanda keterkejutan: “<i>The dove returned to him at sunset, <i>and incredibly</i>, a fresh-picked olive branch was in its mouth!</i>”; lihat "
}
]
]
<<===== CITATION-ITEMS =====<<


>>===== CSL =====>>
<style
xmlns="http://purl.org/net/xbiblio/csl"
class="note"
version="1.0">
<info>
<id />
<title />
<updated>2024-07-10T10:04:59+08:00</updated>
</info>
<citation>
<layout>
<text variable="title"/>
</layout>
</citation>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
{
"id": "Hardy2019-Gemsfr",
"type": "book",
"title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation"
}
]
<<===== INPUT =====<<


>>===== VERSION =====>>
1.0
<<===== VERSION =====<<
52 changes: 52 additions & 0 deletions tests/latex/luatex-1/issue-67.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\input{regression-test}

\documentclass{article}

% <https://github.com/zepinglee/citeproc-lua/issues/67>

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
{
"id": "Hardy2019-Gemsfr",
"type": "book",
"author": [
{
"family": "Hardy",
"given": "H. H.",
"suffix": "II"
}
],
"title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation",
"title-short": "Gems from Biblical Hebrew",
"publisher-place": "Grand Rapids, MI",
"publisher": "Baker Academic",
"issued": {
"date-parts": [
[
"2019"
]
]
}
}
]
\end{filecontents}

\usepackage[style = chicago-fullnote-bibliography]{citation-style-language}
\cslsetup{regression-test = true}
\addbibresource{\jobname.json}


\begin{document}
\START

\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan:
``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11
sebagai penanda keterkejutan: ``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''; lihat },
page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}

\OMIT
\end{document}
16 changes: 16 additions & 0 deletions tests/latex/luatex-1/issue-67.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}.
<recently read> }
l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya)..
<recently read> }
l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....
52 changes: 52 additions & 0 deletions tests/latex/luatex-2/issue-67.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\input{regression-test}

\documentclass{article}

% <https://github.com/zepinglee/citeproc-lua/issues/67>

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
{
"id": "Hardy2019-Gemsfr",
"type": "book",
"author": [
{
"family": "Hardy",
"given": "H. H.",
"suffix": "II"
}
],
"title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation",
"title-short": "Gems from Biblical Hebrew",
"publisher-place": "Grand Rapids, MI",
"publisher": "Baker Academic",
"issued": {
"date-parts": [
[
"2019"
]
]
}
}
]
\end{filecontents}

\usepackage[style = chicago-fullnote-bibliography]{citation-style-language}
\cslsetup{regression-test = true}
\addbibresource{\jobname.json}


\begin{document}
\START

\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan:
``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11
sebagai penanda keterkejutan: ``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''; lihat },
page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}

\OMIT
\end{document}
16 changes: 16 additions & 0 deletions tests/latex/luatex-2/issue-67.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}.
<recently read> }
l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya)..
<recently read> }
l. ...page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....
52 changes: 52 additions & 0 deletions tests/latex/pdftex-1/issue-67.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\input{regression-test}

\documentclass{article}

% <https://github.com/zepinglee/citeproc-lua/issues/67>

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
{
"id": "Hardy2019-Gemsfr",
"type": "book",
"author": [
{
"family": "Hardy",
"given": "H. H.",
"suffix": "II"
}
],
"title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation",
"title-short": "Gems from Biblical Hebrew",
"publisher-place": "Grand Rapids, MI",
"publisher": "Baker Academic",
"issued": {
"date-parts": [
[
"2019"
]
]
}
}
]
\end{filecontents}

\usepackage[style = chicago-fullnote-bibliography]{citation-style-language}
\cslsetup{regression-test = true}
\addbibresource{\jobname.json}


\begin{document}
\START

\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan:
``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11
sebagai penanda keterkejutan: ``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''; lihat },
page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}

\OMIT
\end{document}
17 changes: 17 additions & 0 deletions tests/latex/pdftex-1/issue-67.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}.
<recently read> }
l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
LaTeX Warning: Citation `Hardy2019-Gemsfr' on page 1 undefined on input line ....
> \l__csl_citation_tl=[\textbf {Hardy2019-Gemsfr}].
<recently read> }
l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....
52 changes: 52 additions & 0 deletions tests/latex/pdftex-2/issue-67.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\input{regression-test}

\documentclass{article}

% <https://github.com/zepinglee/citeproc-lua/issues/67>

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
{
"id": "Hardy2019-Gemsfr",
"type": "book",
"author": [
{
"family": "Hardy",
"given": "H. H.",
"suffix": "II"
}
],
"title": "Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation",
"title-short": "Gems from Biblical Hebrew",
"publisher-place": "Grand Rapids, MI",
"publisher": "Baker Academic",
"issued": {
"date-parts": [
[
"2019"
]
]
}
}
]
\end{filecontents}

\usepackage[style = chicago-fullnote-bibliography]{citation-style-language}
\cslsetup{regression-test = true}
\addbibresource{\jobname.json}


\begin{document}
\START

\dots\ dalam Kej.\ 8:11 sebagai penanda keterkejutan:
``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''\cite[prefix = {\dots\ dalam Kej.\ 8:11
sebagai penanda keterkejutan: ``\emph{The dove returned to him
at sunset, \emph{and incredibly}, a fresh-picked olive branch
was in its mouth!}''; lihat },
page = {194 (tekanan saya)}]{Hardy2019-Gemsfr}

\OMIT
\end{document}
16 changes: 16 additions & 0 deletions tests/latex/pdftex-2/issue-67.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
> \l__csl_citation_info_tl=citationID={Hardy2019-Gemsfr@1},citationItems={{id={Hardy2019-Gemsfr},prefix={\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: ``\emph {The dove returned to him at sunset, \emph {and incredibly}, a fresh-picked olive branch was in its mouth!}''; lihat },label={page},locator={194 (tekanan saya)}}},properties={noteIndex={1}}.
<recently read> }
l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
> \l__csl_citation_tl=\dots \ dalam Kej.\ 8:11 sebagai penanda keterkejutan: “\textit {The dove returned to him at sunset, {\normalshape and incredibly}, a fresh-picked olive branch was in its mouth!}”; lihat H. H. Hardy II, \textit {Exegetical Gems from Biblical Hebrew: A Refreshing Guide to Grammar and Interpretation} (Grand Rapids, MI: Baker Academic, 2019), 194 (tekanan saya)..
<recently read> }
l. ...... = {194 (tekanan saya)}]{Hardy2019-Gemsfr}
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....

0 comments on commit 640cc06

Please sign in to comment.