Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html: Add markdown render flags option #605

Closed
wants to merge 4 commits into from

Conversation

ix5
Copy link
Collaborator

@ix5 ix5 commented Dec 28, 2019

New flags option in the [markdown] section to customize Misaka's Markdown HTML rendering.

By default, no flags are set.

[markup]
flags = skip-html, escape, hard-wrap

Update CHANGES.rst and add the section to the sample isso.conf and isso-dev.conf.


Also fix flaky tests and update to python 3.8.

@ix5 ix5 changed the title html: Add markdown render flag option html: Add markdown render flags option Dec 28, 2019
@ix5 ix5 force-pushed the misaka-render-flags branch from 9f00b81 to e275fdb Compare Dec 28, 2019
ix5 added 3 commits Dec 28, 2019
New "flags" option in the [markdown] section to customize
Misaka's Markdown HTML rendering.

By default, no flags are set.

```
[markup]
flags = skip-html, escape, hard-wrap
```

Update CHANGES.rst and add the section to the sample
isso.conf and isso-dev.conf
In isso/views/comments.py:feed() we are adding a "<thr:in-reply-to>"
element:
```
    ET.SubElement(entry, 'thr:in-reply-to', {
        'ref': '[...]',
        'href': '[...],
    })
```
This dict is unsorted an can be emitted in either order when generating
"/feed".

Fix this by normalizing the generated data with str.replace().

Fixes error(abridged):
```
Traceback (most recent call last):
  File "/home/user/isso/isso/tests/test_comments.py", line 389, in testFeed
    self.assertEqual(data, """<?xml version=\'1.0\' encoding=\'utf-8\'?>
AssertionError: '<?xm[537 chars]y-to ref="tag:example.org,2018:/isso/1/1" href[295 chars]eed>' \
  != '<?xm[537 chars]y-to href="https://example.org/path/#isso-1" r[295 chars]eed>'
```
@ix5 ix5 force-pushed the misaka-render-flags branch from e275fdb to 1c6f955 Compare Dec 28, 2019
@jelmer
Copy link
Collaborator

@jelmer jelmer commented Feb 15, 2020

Thanks! Merged in #616

@jelmer jelmer closed this Feb 15, 2020
@ix5 ix5 deleted the misaka-render-flags branch Feb 15, 2020
@ix5
Copy link
Collaborator Author

@ix5 ix5 commented Feb 15, 2020

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants