jelly-beam / rebar3_ex_doc

rebar3 plugin for generating docs with ex_doc
Apache License 2.0
43 stars 13 forks source link

(FunctionClauseError) no function clause matching in ExDoc.Formatter.HTML.strip_tags/2 #60

Closed kianmeng closed 1 year ago

kianmeng commented 1 year ago

Not sure this is related to rebar3_ex_doc, or ExDoc:

$ asdf current
elixir          1.15.4-otp-26   /home/foobar/.tool-versions
erlang          26.0.2          /home/foobar/.tool-versions

To reproduct the error:

cd /tmp

git clone https://github.com/kianmeng/qdate.git --single-branch --branch=generate-doc-using-rebar3-ex-doc --depth=1

cd qdate

DIAGNOSTIC=1 rebar3 ex_doc
===> Evaluating config script "rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,ex_doc]
===> Running provider: app_discovery
===> Found top-level apps: [qdate]
    using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Evaluating config script "/tmp/qdate/_build/default/lib/erlware_commons/rebar.config.script"
===> Running provider: install_deps
===> Verifying dependencies...
===> Running provider: lock
===> Running provider: ex_doc
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for compile with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, compile) -> no hooks defined

===> Compile (project_apps)
===> Running hooks for compile in app qdate (/tmp/qdate) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, compile) -> no hooks defined

===> Running hooks for erlc_compile in app qdate (/tmp/qdate) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, erlc_compile) -> no hooks defined

===> Setting paths to [deps]
===> Analyzing applications...
===> Compiling qdate
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/tmp/qdate/src/qdate_app.erl",
                              "/tmp/qdate/src/qdate_sup.erl",
                              "/tmp/qdate/src/qdate_srv.erl",
                              "/tmp/qdate/src/qdate.erl"]
===> Starting 0 worker(s)
===> Running hooks for erlc_compile in app qdate (/tmp/qdate) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, erlc_compile) -> no hooks defined

===> Running hooks for app_compile in app qdate (/tmp/qdate) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, app_compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for app_compile in app qdate (/tmp/qdate) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, app_compile) -> no hooks defined

===> Running hooks for compile in app qdate (/tmp/qdate) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, compile) -> no hooks defined

===> Running hooks for compile with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [deps,plugins]
===> Running hooks for edoc with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, edoc) -> no hooks defined

===> Running hooks for edoc in app qdate (/tmp/qdate) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/tmp/qdate", pre_hooks, edoc) -> no hooks defined

===> Running edoc for qdate
===> {edoc_opts, [{dir,"/tmp/qdate/_build/docs/lib/qdate/doc"},
                         {doclet,edoc_doclet_chunks},
                         {includes,["src","include"]},
                         {layout,edoc_layout_chunks},
                         {preprocess,true}]}.
===> Running hooks for edoc in app qdate (/tmp/qdate) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, edoc) -> no hooks defined

===> Running hooks for edoc with configuration:
===>    {post_hooks, []}.
===> run_hooks("/tmp/qdate", post_hooks, edoc) -> no hooks defined

===> Setting paths to [plugins,deps]
===> Running ex_doc for qdate
===> sh info:
    cwd: "/tmp/qdate"
    cmd: /tmp/qdate/_build/default/plugins/rebar3_ex_doc/priv/ex_doc qdate 0.7.0 /tmp/qdate/_build/docs/lib/qdate/ebin --source-ref v0.7.0 --config /tmp/qdate/_build/docs/lib/qdate/doc/docs.config --quiet --output /tmp/qdate/doc --package qdate --paths /tmp/qdate/_build/docs/lib/qdate/ebin --paths /tmp/qdate/_build/default/lib/erlware_commons/ebin --paths /tmp/qdate/_build/default/lib/qdate_localtime/ebin --paths /tmp/qdate/_build/default/lib/cf/ebin --language en -f html -f epub

===>    opts: [{return_on_error,true}]

===> Port Cmd: /tmp/qdate/_build/default/plugins/rebar3_ex_doc/priv/ex_doc qdate 0.7.0 /tmp/qdate/_build/docs/lib/qdate/ebin --source-ref v0.7.0 --config /tmp/qdate/_build/docs/lib/qdate/doc/docs.config --quiet --output /tmp/qdate/doc --package qdate --paths /tmp/qdate/_build/docs/lib/qdate/ebin --paths /tmp/qdate/_build/default/lib/erlware_commons/ebin --paths /tmp/qdate/_build/default/lib/qdate_localtime/ebin --paths /tmp/qdate/_build/default/lib/cf/ebin --language en -f html -f epub
Port Opts: [exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof,binary]

===> ** (FunctionClauseError) no function clause matching in ExDoc.Formatter.HTML.strip_tags/2

    The following arguments were given to ExDoc.Formatter.HTML.strip_tags/2:

        # 1
        nil

        # 2
        " "

    (ex_doc 0.30.3) lib/ex_doc/formatter/html.ex:497: ExDoc.Formatter.HTML.strip_tags/2
    (ex_doc 0.30.3) lib/ex_doc/formatter/html/search_data.ex:146: ExDoc.Formatter.HTML.SearchData.clean_html/1
    (ex_doc 0.30.3) lib/ex_doc/formatter/html/search_data.ex:112: ExDoc.Formatter.HTML.SearchData.extract_sections/2
    (ex_doc 0.30.3) lib/ex_doc/formatter/html/search_data.ex:49: ExDoc.Formatter.HTML.SearchData.module/1
    (elixir 1.13.4) lib/enum.ex:4086: Enum.flat_map_list/2
    (ex_doc 0.30.3) lib/ex_doc/formatter/html/search_data.ex:14: ExDoc.Formatter.HTML.SearchData.create/3
    (ex_doc 0.30.3) lib/ex_doc/formatter/html.ex:235: ExDoc.Formatter.HTML.generate_search_data/3
    (ex_doc 0.30.3) lib/ex_doc/formatter/html.ex:26: ExDoc.Formatter.HTML.run/2
paulo-ferraz-oliveira commented 1 year ago

@kianmeng, isn't this the same as #58? (maybe that one's title could be updated to mention strip_tags/2). Fwiw this is an ex_doc / Erlang issue that @starbelly already pull requested to fix.

kianmeng commented 1 year ago

@paulo-ferraz-oliveira Should be, the title already mentioned strip_tags/2.

paulo-ferraz-oliveira commented 1 year ago

I meant the title for #58: that one just states "Error in v0.2.19".

starbelly commented 1 year ago

Hello @kianmeng what others said 👍

ex_doc 0.30.5 has been cut so I will cut a new release of this plugin shortly.

starbelly commented 1 year ago

v0.2.20 has been released to hex. I'll close this issue now, but if you find there is a still a problem, please re-open and ping 😄