Skip to content

Commit

Permalink
Merge b144036 into 4f5af1d
Browse files Browse the repository at this point in the history
  • Loading branch information
cwdavies committed Feb 19, 2020
2 parents 4f5af1d + b144036 commit 58a24ca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 47 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,10 @@ matrix:
include:
- env: TOXENV=lint
python: 3.6
- env: TOXENV=py27-md30
python: 2.7
- env: TOXENV=py27-md31
python: 2.7
- env: TOXENV=py36-md30
- env: TOXENV=py36-md32
python: 3.6
- env: TOXENV=py36-md31
python: 3.6
- env: TOXENV=py37-md30
python: 3.7
- env: TOXENV=py37-md31
python: 3.7
- env: TOXENV=py38-md32
python: 3.8

install:
pip install tox coveralls
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Regdown is a [Python-Markdown](https://python-markdown.github.io) extension for

## Dependencies

- Python 2.7+, 3.6+
- [Python-Markdown](https://python-markdown.github.io) 3.0+
- Python 3.6, 3.8
- [Python-Markdown](https://python-markdown.github.io) 3.2

## Installation

Expand Down
25 changes: 2 additions & 23 deletions regdown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
from markdown import markdown, util
from markdown.blockprocessors import BlockProcessor, ParagraphProcessor
from markdown.extensions import Extension
from markdown.inlinepatterns import (
DoubleTagInlineProcessor,
Pattern,
SimpleTagInlineProcessor,
)
from markdown.inlinepatterns import DoubleTagInlineProcessor, Pattern


# If we're on Python 3.6+ we have SHA3 built-in, otherwise use the back-ported
Expand All @@ -21,15 +17,9 @@
from sha3 import sha3_224


# **strong**
STRONG_RE = r'(\*{2})(.+?)\1'

# ***strongem*** or ***em*strong**
EM_STRONG_RE = r'(\*)\1{2}(.+?)\1(.*?)\1{2}'

# ***strong**em*
STRONG_EM_RE = r'(\*)\1{2}(.+?)\1{2}(.*?)\1'

# Form field: __
# __Form Field
# inline__fields__
Expand Down Expand Up @@ -73,24 +63,13 @@ def extendMarkdown(self, md):

# Replace all inlinePatterns that include an underscore with patterns
# that do not include underscores.
md.inlinePatterns.deregister('strong_em')
md.inlinePatterns.deregister('em_strong')
md.inlinePatterns.deregister('strong')
md.inlinePatterns.deregister('strong2')
md.inlinePatterns.deregister('emphasis2')
md.inlinePatterns.deregister('em_strong2')

md.inlinePatterns.register(
DoubleTagInlineProcessor(EM_STRONG_RE, 'strong,em'),
'em_strong',
60
)
md.inlinePatterns.register(
DoubleTagInlineProcessor(STRONG_EM_RE, 'em,strong'),
'strong_em',
50
)
md.inlinePatterns.register(
SimpleTagInlineProcessor(STRONG_RE, 'strong'), 'strong', 40)

# Add inline emdash and pseudo form patterns.
md.inlinePatterns.register(EmDashPattern(EMDASH_RE), 'emdash', 200)
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


install_requires = [
'Markdown>=3.0,<4.0',
'Markdown>=3.2',
'sha3==0.2.1',
]

Expand Down Expand Up @@ -37,10 +37,6 @@
'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
'License :: Public Domain',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
]
)
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
skipsdist=True
envlist=
lint,
py{27,36,37}-md{30,31}
py{36,38}-md{32}

[testenv]
install_command=pip install -e ".[testing]" -U {opts} {packages}
Expand All @@ -12,13 +12,11 @@ commands=
coverage report -m

basepython=
py27: python2.7
py36: python3.6
py37: python3.7
py38: python3.8

deps=
md30: Markdown>=3.0,<3.1
md31: Markdown>=3.1,<3.2
md32: Markdown>=3.2,<3.3

[testenv:lint]
basepython=python3.6
Expand All @@ -42,7 +40,7 @@ include_trailing_comma=1
multi_line_output=3
skip=.tox
use_parentheses=1
known_future_library=future,six
known_future_library=future
default_section=THIRDPARTY
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

Expand Down

0 comments on commit 58a24ca

Please sign in to comment.