forked from strictdoc-project/strictdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request strictdoc-project#1926 from strictdoc-project/stan…
…islaw/fix_type_issue Code climate: markup_renderer: remove unused code
- Loading branch information
Showing
4 changed files
with
40 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# mypy: disable-error-code="no-untyped-def" | ||
class HTMLFragmentWriter: | ||
@staticmethod | ||
def write(text_fragment): | ||
def write(text_fragment: str) -> str: | ||
return text_fragment | ||
|
||
@staticmethod | ||
def write_link(title, _): | ||
return f"{title}" | ||
def write_anchor_link(title: str, href: str) -> str: | ||
return f'<a href="{href}">🔗 {title}</a>`' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
# mypy: disable-error-code="no-untyped-def" | ||
import html | ||
|
||
|
||
class TextToHtmlWriter: | ||
@staticmethod | ||
def write(text_fragment): | ||
def write(text_fragment: str) -> str: | ||
return html.escape(text_fragment, quote=True).replace("\n", "<br/>\n") | ||
|
||
@staticmethod | ||
def write_link(title, _): | ||
return f"{title}" | ||
def write_anchor_link(title: str, href: str) -> str: | ||
return f'<a href="{href}">🔗 {title}</a>`' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters