Skip to content

Commit

Permalink
Fix markdown see link generation
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Mar 27, 2020
1 parent ff24ca0 commit 77619c8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion HOWTO/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ Use `hipe:help_options/0` to print out the available options.
[html documentation]: http://www.erlang.org/download/otp_doc_html_%OTP-VSN%.tar.gz
[man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-VSN%.tar.gz
[the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-VSN%.tar.gz
[System Principles]: ../system_principles/system_principles
[System Principles]: system/system_principles:system_principles
[native build]: #How-to-Build-and-Install-ErlangOTP
[cross build]: INSTALL-CROSS.md
[Required Utilities]: #Required-Utilities
Expand Down
8 changes: 4 additions & 4 deletions HOWTO/OTP-PATCH-APPLY.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dependencies among applications actually loaded.
Please take a look at the reference of [sanity_check()][] for more
information.

[application resource file]: kernel:app
[runtime_dependencies]: kernel:app#runtime_dependencies
[application resource file]: seefile/kernel:app
[runtime_dependencies]: seefile/kernel:app#runtime_dependencies
[building and installing Erlang/OTP]: INSTALL.md
[version handling]: ../system_principles/versions
[sanity_check()]: runtime_tools:system_information#sanity_check-0
[version handling]: system/system_principles:versions
[sanity_check()]: seemfa/runtime_tools:system_information#sanity_check/0
20 changes: 13 additions & 7 deletions make/emd2exml.in
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,8 @@ link_or_image(Str, Type) ->
Cont2};
{seealso, SeeAlso, _Title, Cont2} ->
case internal_seealso(SeeAlso) of
no ->
{["<seeguide marker=\"", text(SeeAlso), "\">",
text(Text), "</seeguide>"],
Cont2};
{no,Link} ->
{make_seealso(Link, Text),Cont2};
{yes, SeeAlsoKey} ->
{delayed, link, SeeAlsoKey, text(Text), Cont2}
end;
Expand All @@ -492,8 +490,16 @@ link_or_image(Str, Type) ->

internal_seealso("#" ++ Marker) ->
{yes, {internal, Marker}};
internal_seealso(_) ->
no.
internal_seealso(Link) ->
{no, Link}.

make_seealso("see" ++ _ = Link, Text) ->
[Tag, Target] = string:split(Link,"/"),
["<",Tag," marker=\"", text(Target), "\">",
text(Text), "</",Tag,">"];
make_seealso(Link, Text) ->
["<seeguide marker=\"", text(Link), "\">",
text(Text), "</seeguide>"].

link_or_image_text(Cs0) ->
{Prefix, Cs2} = case Cs0 of
Expand Down Expand Up @@ -575,7 +581,7 @@ mk_image(Title, Url) ->
mk_link(Text, Url) ->
case chk_proto(Url) of
true -> ["<url href=\"", text(Url), "\">", text(Text), "</url>"];
false -> ["<seeguide marker=\"", text(Url), "\">", text(Text), "</seeguide>"]
false -> make_seealso(Url, Text)
end.

chk_proto("://" ++ _) ->
Expand Down

0 comments on commit 77619c8

Please sign in to comment.