Projects
openEuler:Mainline
python-markdown
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:python-markdown.spec
Changed
@@ -2,12 +2,14 @@ Name: python-markdown Version: 3.3.7 -Release: 1 +Release: 2 Summary: A Python implementation of John Gruber’s Markdown License: BSD-3-Clause URL: https://pypi.org/project/Markdown/ Source0: https://pypi.python.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz +Patch0: 0001-Update-th-td-to-use-style-attribute.patch + BuildArch: noarch BuildRequires: python3-devel >= 3.1 python3-nose2 python3-pyyaml @@ -47,6 +49,9 @@ %{_bindir}/markdown_py %changelog +* Tue Jan 17 2023 caofei <caofei@xfusion.com> - 3.3.7-2 +- Update th/td to use style attribute + * Thu Jun 09 2022 SimpleUpdate Robot <tc@openeuler.org> - 3.3.7-1 - Upgrade to version 3.3.7
View file
_service:tar_scm:0001-Update-th-td-to-use-style-attribute.patch
Added
@@ -0,0 +1,1715 @@ +From 659a43659c6012df8d8ceb4a3681d2ddb1cb7540 Mon Sep 17 00:00:00 2001 +From: Gaige B Paulsen <github@gbp.gaige.net> +Date: Thu, 5 May 2022 15:32:07 -0400 +Subject: PATCH Update th/td to use style attribute + +This allows better interoperation with CSS style sheets, as the align +object on the TH is skipped if the css uses 'text-align: inherit' and +the previous 'text-align' is used instead (or the default: left). + +Added an override to restore the original `align` behavior +Moved existing tests to the new test infrastructure +Added new tests to test the configuration parameter +Updated documentation to document the configuration parameter. +--- + docs/change_log/index.md | 2 + + docs/change_log/release-3.4.md | 44 + + docs/extensions/tables.md | 22 +- + markdown/extensions/tables.py | 19 +- + tests/extensions/extra/tables.html | 466 ----------- + tests/extensions/extra/tables.txt | 169 ---- + tests/test_legacy.py | 2 - + tests/test_syntax/extensions/test_tables.py | 860 ++++++++++++++++++++ + 8 files changed, 943 insertions(+), 641 deletions(-) + create mode 100644 docs/change_log/release-3.4.md + delete mode 100644 tests/extensions/extra/tables.html + delete mode 100644 tests/extensions/extra/tables.txt + +diff --git a/docs/change_log/index.md b/docs/change_log/index.md +index 09ace62..fc78087 100644 +--- a/docs/change_log/index.md ++++ b/docs/change_log/index.md +@@ -3,6 +3,8 @@ title: Change Log + Python-Markdown Change Log + ========================= + ++Under development: version 3.4.0 (Notes(release-3.4.md)). ++ + May 5, 2022: version 3.3.7 (a bug-fix release). + + * Disallow square brackets in reference link ids (#1209). +diff --git a/docs/change_log/release-3.4.md b/docs/change_log/release-3.4.md +new file mode 100644 +index 0000000..0070da9 +--- /dev/null ++++ b/docs/change_log/release-3.4.md +@@ -0,0 +1,44 @@ ++title: Release Notes for v3.4 ++ ++# Python-Markdown 3.4 Release Notes ++ ++Python-Markdown version 3.4 supports Python versions 3.6, 3.7, 3.8, 3.9 and PyPy3. ++ ++## Backwards-incompatible changes ++ ++### The `table` extension now uses a `style` attribute instead of `align` attribute for alignment. ++ ++The HTML4 specspec4 specifically ++deprecates the use of the `align` attribute and it does not appear at all in the ++HTML5 specspec5. Therefore, by default, the table extension will now use the `style` ++attribute (setting just the `text-align` property) in `td` and `th` blocks. ++ ++spec4: https://www.w3.org/TR/html4/present/graphics.html#h-15.1.2 ++spec5: https://www.w3.org/TR/html53/tabular-data.html#attributes-common-to-td-and-th-elements ++ ++The former behavior is available by setting the setting `use_align_attribute` configuration ++option to `True` when adding the extension. ++ ++For example, to configure the old `align` behavior: ++ ++```python ++from markdown.extensions.tables import TableExtension ++ ++markdown.markdown(src, extensions=TableExtension(use_align_attribute=True)) ++``` ++ ++In addition, tests were moved to the modern test environment. ++ ++## New features ++ ++The following new features have been included in the 3.3 release: ++ ++* Use `style` attribute in tables for alignment instead of `align` for better CSS ++ inter-operation. The old behavior is available by setting `use_align_attribute=True` when ++ adding the extension. ++ ++## Bug fixes ++ ++The following bug fixes are included in the 3.4 release: ++ ++ +diff --git a/docs/extensions/tables.md b/docs/extensions/tables.md +index 30b7636..aaffc09 100644 +--- a/docs/extensions/tables.md ++++ b/docs/extensions/tables.md +@@ -58,10 +58,30 @@ Usage + See Extensions(index.md) for general extension usage. Use `tables` as the + name of the extension. + +-This extension does not accept any special configuration options. ++See the Library Reference(../reference.md#extensions) for information about ++configuring extensions. ++ ++The following options are provided to change the default behavior: ++ ++* **`use_align_attribute`**: Set to `True` to use `align` instead of an appropriate `style` attribute ++ ++ Default: `'False'` ++ + + A trivial example: + + ```python + markdown.markdown(some_text, extensions='tables') + ``` ++ ++### Examples ++ ++For an example, let us suppose that alignment should be controlled by the legacy `align` ++attribute. ++ ++```pycon ++>>> from markdown.extensions.tables import TableExtension ++>>> html = markdown.markdown(text, ++... extensions=TableExtension(use_align_attribute=True) ++... ) ++``` +diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py +index 0a9d084..c8b1024 100644 +--- a/markdown/extensions/tables.py ++++ b/markdown/extensions/tables.py +@@ -30,9 +30,11 @@ class TableProcessor(BlockProcessor): + RE_CODE_PIPES = re.compile(r'(?:(\\\\)|(\\`+)|(`+)|(\\\|)|(\|))') + RE_END_BORDER = re.compile(r'(?<!\\)(?:\\\\)*\|$') + +- def __init__(self, parser): ++ def __init__(self, parser, config): + self.border = False + self.separator = '' ++ self.config = config ++ + super().__init__(parser) + + def test(self, parent, block): +@@ -126,7 +128,10 @@ class TableProcessor(BlockProcessor): + except IndexError: # pragma: no cover + c.text = "" + if a: +- c.set('align', a) ++ if self.config'use_align_attribute': ++ c.set('align', a) ++ else: ++ c.set('style', f'text-align: {a};') + + def _split_row(self, row): + """ split a row of text into list of cells. """ +@@ -212,11 +217,19 @@ class TableProcessor(BlockProcessor): + class TableExtension(Extension): + """ Add tables to Markdown. """ + ++ def __init__(self, **kwargs): ++ self.config = { ++ 'use_align_attribute': False, 'True to use align attribute instead of style.', ++ } ++ ++ super().__init__(**kwargs) ++ + def extendMarkdown(self, md): + """ Add an instance of TableProcessor to BlockParser. """ + if '|' not in md.ESCAPED_CHARS: + md.ESCAPED_CHARS.append('|') +- md.parser.blockprocessors.register(TableProcessor(md.parser), 'table', 75) ++ processor = TableProcessor(md.parser, self.getConfigs()) ++ md.parser.blockprocessors.register(processor, 'table', 75) + + + def makeExtension(**kwargs): # pragma: no cover +diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html +deleted file mode 100644 +index 25dee48..0000000 +--- a/tests/extensions/extra/tables.html ++++ /dev/null +@@ -1,466 +0,0 @@ +-<h2>Table Tests</h2> +-<table> +-<thead> +-<tr> +-<th>First Header</th> +-<th>Second Header</th> +-</tr> +-</thead> +-<tbody> +-<tr> +-<td>Content Cell</td> +-<td>Content Cell</td> +-</tr> +-<tr> +-<td>Content Cell</td> +-<td>Content Cell</td> +-</tr>
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/python-markdown.git</param> - <param name="revision">6abdc03e25350516af40f19b670af900f009cb3b</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2