From 9a91485c10e059dee1374e152e4b068cd9d3866c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 5 Dec 2019 11:41:09 -0500 Subject: 0.9.2 @safe & @trusted first pass --- src/doc_reform/io_out/latex.d | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/doc_reform/io_out/latex.d') diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index 6e651dd..a97a697 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -14,7 +14,7 @@ template outputLaTeX() { auto lang = Lang(); auto paper() { struct PaperType { - auto a4() { + auto a4() @safe { struct A4 { auto portrait() { struct V { @@ -35,7 +35,7 @@ template outputLaTeX() { } return A4(); } - auto a5() { + auto a5() @safe { struct A5 { auto portrait() { struct V { @@ -56,7 +56,7 @@ template outputLaTeX() { } return A5(); } - auto b4() { + auto b4() @safe { struct B4 { auto portrait() { struct V { @@ -77,7 +77,7 @@ template outputLaTeX() { } return B4(); } - auto letter() { + auto letter() @safe { struct Letter { auto portrait() { struct V { @@ -98,7 +98,7 @@ template outputLaTeX() { } return Letter(); } - auto legal() { + auto legal() @safe { struct Legal { auto portrait() { struct V { @@ -125,7 +125,7 @@ template outputLaTeX() { string sp_char_esc(O)( string _txt, const O obj, - ) { + ) @safe { string _unescape_sp_char_esc()(string _txt) { _txt = _txt .replaceAll(rgx.latex_special_char_escaped, @@ -149,7 +149,7 @@ template outputLaTeX() { } string sp_char_esc_txt()( string _txt, - ) { + ) @safe { string _unescape_sp_char_esc()(string _txt) { _txt = _txt .replaceAll(rgx.latex_special_char_escaped, @@ -171,7 +171,7 @@ template outputLaTeX() { } string fontface()( string _txt, - ) { + ) @safe { _txt = _txt .replaceAll(rgx.inline_emphasis, format(q"┃\begin{bfseries}%s\end{bfseries}┃", "$1")) .replaceAll(rgx.inline_bold, format(q"┃\begin{bfseries}%s\end{bfseries}┃", "$1")) @@ -187,7 +187,7 @@ template outputLaTeX() { } string leading_hardspaces()( string _txt, - ) { + ) @safe { string hardspaces(string _spaces) { _spaces = _spaces .replaceAll(rgx.space, "\\hardspace "); @@ -196,13 +196,13 @@ template outputLaTeX() { _txt = replaceAll!(m => hardspaces(m[0]))(_txt, rgx.spaces_line_start); return _txt; } - string nbsp_char()(string _txt) { + string nbsp_char()(string _txt) @safe { if (_txt.match(rgx.nbsp_char)) { _txt = _txt.replaceAll(rgx.nbsp_char, "\\hardspace "); } return _txt; } - string nbsp_char_to_space()(string _txt) { + string nbsp_char_to_space()(string _txt) @safe { if (_txt.match(rgx.nbsp_char)) { _txt = _txt.replaceAll(rgx.nbsp_char, " "); } @@ -212,7 +212,7 @@ template outputLaTeX() { string _txt, const O obj, M doc_matters, - ) { + ) @safe { if (obj.has.inline_links) { // TODO some images do not have inline links ... image without link string _width_adjust(string _width) { if (_width.to!int > 300) { _width = "300"; } // will need to vary max with papersize & orientation @@ -255,7 +255,7 @@ template outputLaTeX() { } string footnotes()( string _txt, - ) { + ) @safe { if (_txt.match(rgx.inline_notes_al_gen)) { string _tex_note = q"┃\hypertarget{noteref_%s}{}\footnote[%s]{%% \label{note_%s}%s}┃"; @@ -270,7 +270,7 @@ template outputLaTeX() { } string remove_footnotes()( string _txt, - ) { + ) @safe { if (_txt.match(rgx.inline_notes_al_gen)) { _txt = replaceAll!(m => "")(_txt, rgx.inline_notes_al_gen); } @@ -279,7 +279,7 @@ template outputLaTeX() { string para(O)( string _txt, O obj, - ) { + ) @safe { if (obj.metainfo.is_of_type == "para") { string _tex_para; _tex_para = q"┃\begin{tiny}\hspace{0mm}\end{tiny}{\marginpar{\begin{tiny}\hspace{0mm}\hypertarget{%s}{%s}\end{tiny}}}%s┃"; @@ -294,7 +294,7 @@ template outputLaTeX() { string bookindex(O)( string _txt, O obj, - ) { + ) @safe { if (obj.metainfo.is_of_type == "para" && obj.metainfo.is_a == "bookindex" ) { @@ -311,7 +311,7 @@ template outputLaTeX() { O obj, M doc_matters, string _part = "" - ) { + ) @safe { if (obj.metainfo.is_a == "heading") { string _tex_para; string _pg_break; @@ -642,7 +642,7 @@ string table(O,M)( string bullets_and_indentation(O)( string _txt, O obj, - ) { + ) @safe { string _tex_para; string _hang; string _indent; int _paper_margin = -10; -- cgit v1.2.3