Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #660: Replace HTML entities before markdownify in docs #690

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

acq688
Copy link
Contributor

@acq688 acq688 commented Jul 26, 2022

See Issue: (#660)

Hi -- I thought I'd take a look at #660 as a good first issue in the project. However, it ended up being more complicated than characters not being escaped correctly. 😅

I believe this is being caused by an interaction between kramdown and markdownify in Github Pages specifically because this section is a code block nested inside of a <div> which in turn is nested inside of <details>. Since the <div> in question has markdown="0" set, kramdown outputs this block as HTML, with the characters ">", "<", and "&" represented as &gt;, &lt; and &amp;. When it hits the markdownify, it's trying to do syntax highlighting, so it wraps the semicolon in a span and the HTML becomes malformed:

Less than: &amp;gt<span class="p">;</span>
Greater than: &amp;lt<span class="p">;</span>
Ampersand: &amp;amp<span class="p">;</span>

This is not a pretty fix -- it turns those HTML entities back into their characters before converting the section to markdown. Based on what I tried, I think this should actually be addressed in one of those two libraries and how nested code blocks are handled, but this pr should fix your documentation if you'd like.

Screen Shot 2022-07-26 at 1 20 30 PM

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements (place an x in each [ ])

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@CLAassistant
Copy link

CLAassistant commented Jul 26, 2022

CLA assistant check
All committers have signed the CLA.

@acq688
Copy link
Contributor Author

acq688 commented Jul 26, 2022

When I ran ./scripts/install_all_and_run_tests.sh, I got a failure in tests/scenario_tests/test_events_socket_mode.py::TestEventsSocketMode::test_middleware, but when I ran just that file, all the tests passed. I am curious if other people ran into this issue or if maybe I've got something set up wrong.

@seratch seratch added the docs Improvements or additions to documentation label Jul 27, 2022
@seratch seratch added this to the 1.14.4 milestone Jul 27, 2022
@seratch seratch self-assigned this Jul 27, 2022
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seratch
Copy link
Member

seratch commented Jul 27, 2022

Hi @acq688, thanks for taking the time to resolve this issue! The test failure you observed is a known issue and it's totally unrelated to your change. Once the CI builds pass, we will merge this PR.

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #690 (205111a) into main (5ec8e15) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #690   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         172      172           
  Lines        5869     5869           
=======================================
  Hits         5403     5403           
  Misses        466      466           

Help us with your feedback. Take ten seconds to tell us how you rate us.

@seratch seratch merged commit c86067d into slackapi:main Jul 27, 2022
@seratch seratch modified the milestones: 1.14.4, 1.15.0 Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants