~sircmpwn/core.sr.ht

538f2fbe3005ad295ae751a050b0232e58c6aedc — Drew DeVault 1 year, 6 months ago c4fc432 0.59.12
Add .table styles to markdown tables
3 files changed, 10 insertions(+), 3 deletions(-)

M srht/api.py
M srht/markdown.py
M srht/scss/base.scss
M srht/api.py => srht/api.py +1 -1
@@ 74,7 74,7 @@ def get_results(url, user_or_token):
        rurl = f"{url}?start={response['next']}"
        r = requests.get(rurl, headers=get_authorization(user_or_token))
        if r.status_code != 200:
            raise Exception(r.json())
            raise Exception(r.text)
        response = r.json()
        yield from response["results"]


M srht/markdown.py => srht/markdown.py +5 -2
@@ 10,7 10,7 @@ import bleach
import misaka as m
import re

SRHT_MARKDOWN_VERSION = 3
SRHT_MARKDOWN_VERSION = 4

class RelativeLinkPrefixRenderer(m.HtmlRenderer):
    def __init__(self, *args, link_prefix=None, **kwargs):


@@ 142,7 142,10 @@ def markdown(text, tags=[], baselevel=1, link_prefix=None):
    html = cleaner.clean(html)
    formatter = HtmlFormatter()
    style = formatter.get_style_defs('.highlight') + " .highlight { background: inherit; }"
    return Markup(f"<style>{style}</style>" + add_noopener(html))
    return Markup(f"<style>{style}</style>"
            + "<div class='markdown'>"
            + add_noopener(html)
            + "</div>")

Heading = namedtuple("Header", ["level", "name", "id", "children", "parent"])


M srht/scss/base.scss => srht/scss/base.scss +4 -0
@@ 291,3 291,7 @@ code {
  background: transparent;
  color: black;
}

.markdown table {
  @extend .table;
}