Skip to content

Commit

Permalink
Merge pull request #443 from Witiko/fix/search-for-markdown-input
Browse files Browse the repository at this point in the history
Make `\markdownInput` search in `\l_file_search_path_seq`
  • Loading branch information
Witiko authored May 27, 2024
2 parents 019d995 + c980d0e commit 83c781b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Development:
normalizing markdown text using Unicode normalization.
(#434, #442, sponsored by @istqborg)

Fixes:

- Make `\markdownInput` search in `\l_file_search_path_seq`.
(#443, reported by @robertjlee)

Documentation:

- Add a link to a work-in-progress article for TUGboat 45:2 to `README.md`.
Expand Down
38 changes: 37 additions & 1 deletion markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -34218,6 +34218,42 @@ end
%
% \end{markdown}
% \begin{macrocode}
\ExplSyntaxOn
\cs_new:Npn
\markdownInput
#1
{
% \end{macrocode}
% \begin{markdown}
%
% If the file does not exist in the current directory, we will search for it in
% the directories specified in \mref{l_file_search_path_seq}. On \LaTeX, this
% also includes the directories specified in \mref{input@path}.
%
% \end{markdown}
% \begin{macrocode}
\file_get_full_name:nNTF
{ #1 }
\l_tmpa_tl
{
\exp_args:NV
\markdownInputRaw
\l_tmpa_tl
}
{
\msg_error:nnnV
{ markdown }
{ markdown-file-does-not-exist }
{ #1 }
}
}
\msg_new:nnn
{ markdown }
{ markdown-file-does-not-exist }
{
Markdown~file~#1~does~not~exist
}
\ExplSyntaxOff
\begingroup
% \end{macrocode}
% \begin{markdown}
Expand All @@ -34229,7 +34265,7 @@ end
\catcode`|=0%
\catcode`\\=12%
\catcode`|&=6%
|gdef|markdownInput#1{%
|gdef|markdownInputRaw#1{%
% \end{macrocode}
% \begin{markdown}
% Change the category code of the percent sign (`\%`) to other, so that a user
Expand Down

0 comments on commit 83c781b

Please sign in to comment.