This is relevant when using optional items in the expression. E.g. if an
optional captured group is not matched, the result of
`match.groupdict()` contains the captured group with value `None`.
* Wrap HTML attributes in quotes according to their content. If it contains a double quote use single quotes, otherwise escape with double quotes.
* Add escape_html utility to ensure quote entities are converted identically across Python versions.
Fixes#1260
* speed up via reduced slugify calls (only call when needed)
* fix __repr__ to not contain str, should call repr on name
* add test_urlwrappers and move URLWrappers tests there
* add new equality test
* cleanup header
additionally:
* Content is now decorated with python_2_unicode_compatible
instead of treating __str__ differently
* better formatting for test_article_metadata_key_lowercase
to actually output the conflict instead of a non descriptive
error
Idea borrowed from Docutils. This allows one to write author lists in
lastname,firstname format. The code change also means that readers with
fancy metadata that can natively represent lists (e.g. Docutils itself,
or MD-Yaml) don't have to merge 'em back together for process_metadata's
sake.
* move all metadata tests to use a single function call (assertDictHasSubset)
* add tests for assertDictHasSubset
* correct some tests that iterated over metadata instead of expected metadata, resulting in metadata that was expected to be there but was not
* correct resulting broken tests
* add additional tests for EXTRA_PATH_METADATA
* make MdReaderTest fail if Markdown is not available instead of skipping each method individually
Typogrify interferes with certain sections of the output that it should not touch (see #1407 for more details).
This feature adds a setting called TYPOGRIFY_IGNORE_LIST which is a list of tag for Typogrify to ignore.
The following was updated:
1. readers.py - if TYPOGRIFY_IGNORE_TAGS is present, then use it
2. settings.ps - default TYPOGRIFY_IGNORE_TAGS to []
3. contents/article_with_code_block.rst - an article with a code block for typogrify to ignore
4. updated tests
5. updated documentation
reverts getpelican/pelican@ddcccfeaa9
If one used a locale that made use of unicode characters (like fr_FR.UTF-8)
the files on disk would be in correct locale while links would be to C.
Uses a SafeDatetime class that works with unicode format strigns
by using custom strftime to prevent ascii decoding errors with Python2.
Also added unicode decoding for the calendar module to fix period
archives.
The reader would return a list of authors already, but
METADATA_PROCESSORS['authors'] expects a string.
Added a test case for this (only the HTMLReader had it).
publication time and date and the last modified time and date
independently.
This makes it possible to access the last updated date with {{ article.locale_modified }} in templates.
Additionally, an already delivered feed entry can be corrected by changing the modified date and time, as it is used for atom:update
/ rss pubDate field now.
smartypants is now py3 compatible but the default settings for double quotes has
been changed (http://pythonhosted.org/smartypants/changes.html).
This commit:
- update the typogrify test (change quotes, and add more test casesi: caps word,
ellipsis)
- install typogrify on travis
- uses upstream version of smartypants in tox instead of dmdm's fork for py3
Add a `Readers` class which contains a dict of file extensions / `Reader`
instances. This dict can be overwritten with a `READERS` settings, for instance
to avoid processing *.html files:
READERS = {'html': None}
Or to add a custom reader for the `foo` extension:
READERS = {'foo': FooReader}
This dict is no storing the Reader classes as it was done before with
`EXTENSIONS`. It stores the instances of the Reader classes to avoid instancing
for each file reading.
If a setting exists in DEFAULT_CONFIG, assume it will be there
(instead of checking and/or providing a local default). The earlier
code was split between the two idioms, which was confusing.
This avoids harcoding test-specific overrides, and makes it easy to
setup a settings dictionary based on DEFAULT_CONFIG for testing.
Because you can trust Pelican to use settings based on DEFAULT_CONFIG,
you are free to go about using:
settings[my_key]
instead of:
settings.get(my_key, some_fallback)
or:
if my_key in settings:
...
if you know that `my_key` is in DEFAULT_CONFIG.
AdReaderTest.test_article_with_asc_extension() has had duplicate
checks on the expected metadata since it was created by 49f481e3 (Add
asciidoc reader support, 2013-10-28). This commit removes the
duplicate entry.
Markdown instance carries state for subsequent uses. Content
and summary parsing is done with the same instance. Since
footnotes are processed with an extension and stored as state,
content footnote is duplicated for summary.
This PR adds a ``.reset()`` call before summary parsing to clear
the state. It also adds a test case with footnotes.
Tempdirs should have useful prefixes to aid in collecting information
about failed tests.
Implicit concatenation is better than backslash line continuation.