1
0
Fork 0
mirror of https://github.com/lise-henry/crowbook synced 2024-05-10 16:56:07 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot] 305c814fb2
Merge 26465ce2ed into 5052bba5da 2024-01-31 05:56:24 -07:00
github-actions[bot] 5052bba5da
docs(contributor): contrib-readme-action has updated readme 2024-01-24 00:59:31 +00:00
Lizzie Crowdagger 666c90be1b Fix carriage return bug in syntax highlighting 2024-01-24 01:59:11 +01:00
2 changed files with 8 additions and 16 deletions

View File

@ -187,10 +187,10 @@ See the
</a>
</td>
<td align="center">
<a href="https://github.com/taophp">
<img src="https://avatars.githubusercontent.com/u/5610065?v=4" width="100;" alt="taophp"/>
<a href="https://github.com/hfiguiere">
<img src="https://avatars.githubusercontent.com/u/114441?v=4" width="100;" alt="hfiguiere"/>
<br />
<sub><b>Stéphane Mourey</b></sub>
<sub><b>Hubert Figuière</b></sub>
</a>
</td></tr>
<tr>
@ -201,13 +201,6 @@ See the
<sub><b>Alfa</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/hfiguiere">
<img src="https://avatars.githubusercontent.com/u/114441?v=4" width="100;" alt="hfiguiere"/>
<br />
<sub><b>Hubert Figuière</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dvalter">
<img src="https://avatars.githubusercontent.com/u/38795282?v=4" width="100;" alt="dvalter"/>
@ -235,15 +228,15 @@ See the
<br />
<sub><b>Josh Stone</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/mgeisler">
<img src="https://avatars.githubusercontent.com/u/89623?v=4" width="100;" alt="mgeisler"/>
<br />
<sub><b>Martin Geisler</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/sigurdsvela">
<img src="https://avatars.githubusercontent.com/u/5571884?v=4" width="100;" alt="sigurdsvela"/>

View File

@ -1,4 +1,4 @@
// Copyright (C) 2017-2023 Élisabeth HENRY.
// Copyright (C) 2017-2024 Élisabeth HENRY.
//
// This file is part of Crowbook.
//
@ -102,7 +102,6 @@ impl Syntax {
let mut content = escape::tex(text).into_owned();
content = insert_breaks(&content);
content = content
.replace('\n', "\\\\{}\n")
.replace(' ', "\\hphantom{ }\\allowbreak{}");
content = format!("\\texttt{{{content}}}");
if style.foreground != Color::BLACK {
@ -121,8 +120,8 @@ impl Syntax {
content = format!("\\underline{{{content}}}");
}
formatted_code.push_str(&content);
formatted_code.push_str("\n");
}
formatted_code.push_str("\\\\{}\n");
}
Ok(format!("{{\\sloppy {formatted_code}}}"))
}