Skip to content

Commit

Permalink
remove spaces and line breaks inside urls (#190)
Browse files Browse the repository at this point in the history
* remove spaces and line breaks inside urls

* adding a comment

* CHANGES

* black
  • Loading branch information
mmatera authored Feb 16, 2023
1 parent 4c130b8 commit 733f549
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ CHANGES
- Python Implementation (CPython, PyPy, Pyston) explicitly is shown
- Optional Python packages are also shown along with their version

* In documentation, ``<url>...</url>`` admits now to be splitted in
several indented lines.

5.0.0
-----

Expand Down
13 changes: 13 additions & 0 deletions mathics_django/doc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ def repl_list(match):
def repl_hypertext(match):
tag = match.group("tag")
content = match.group("content")
#
# Sometimes it happens that the URL does not
# fit in 80 characters. Then, to avoid that
# flake8 complains, and also to have a
# nice and readable ASCII representation,
# we would like to split the URL in several,
# lines, having indentation spaces.
#
# The following line removes these extra
# characters, which would spoil the URL,
# producing a single line, space-free string.
#
content = content.replace(" ", "").replace("\n", "")
if tag == "em":
return r"<em>%s</em>" % content
elif tag == "url":
Expand Down

0 comments on commit 733f549

Please sign in to comment.