diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index bed7a173c..a34725427 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -2,7 +2,7 @@
## Checklist
- [ ] I am running the latest version. Installing Isso from GitHub from the `master` branch does not fix my issue
- [ ] I have checked the [troubleshooting guide](https://isso-comments.de/docs/guides/troubleshooting/)
-- [ ] I have searched the [open issues](https://github.com/posativ/isso/issues), but my issue has not already been reported
+- [ ] I have searched the [open issues](https://github.com/isso-comments/isso/issues), but my issue has not already been reported
## What is not working?
diff --git a/CHANGES.rst b/CHANGES.rst
index cb2a4219b..3ac495712 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,8 +8,10 @@ New Features
^^^^^^^^^^^^
- Add Catalan localisation (`#966`_, welpo)
+- Make for syntax highlighting (`#998`_, pkvach)
.. _#966: https://github.com/posativ/isso/pull/966
+.. _#998: https://github.com/isso-comments/isso/pull/998
Breaking Changes
^^^^^^^^^^^^^^^^
@@ -24,6 +26,7 @@ Bugfixes & Improvements
- Make language code handling more robust (`#983`_, ix5)
- Prevent auto creation of invalid links in comments (`#995`_, pkvach)
- Fix W3C Validation issues (`#999`_, pkvach)
+- Handle deleted comments in Disqus migration (`#994`_, pkvach)
- Fix total comments count calculation (`#997`_, pkvach)
.. _#951: https://github.com/posativ/isso/pull/951
@@ -31,6 +34,7 @@ Bugfixes & Improvements
.. _#983: https://github.com/posativ/isso/pull/983
.. _#995: https://github.com/isso-comments/isso/pull/995
.. _#999: https://github.com/isso-comments/isso/pull/999
+.. _#994: https://github.com/isso-comments/isso/pull/994
.. _#997: https://github.com/isso-comments/isso/pull/997
0.13.1.dev0 (2023-02-05)
diff --git a/README.md b/README.md
index 67668e569..012e3dcc1 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ A Docker image with the latest stable release is provided at
## Contributing
- Pull requests are very much welcome! These might be
- [good first issues](https://github.com/posativ/isso/labels/good-first-issue)
+ [good first issues](https://github.com/isso-comments/isso/labels/good-first-issue)
- See [Ways to Contribute](https://isso-comments.de/docs/contributing/)
- [Translate](https://isso-comments.de/docs/contributing/#translations)
@@ -66,7 +66,7 @@ Refer to the docs for
- Join `#isso` via [Matrix](https://matrix.to/#/#isso:libera.chat) or via IRC on
[Libera.Chat](https://libera.chat/)
-- Ask a question on [GitHub Discussions](https://github.com/posativ/isso/discussions).
+- Ask a question on [GitHub Discussions](https://github.com/isso-comments/isso/discussions).
## License
diff --git a/apidoc/footer.md b/apidoc/footer.md
index dfdec1f55..7124a035f 100644
--- a/apidoc/footer.md
+++ b/apidoc/footer.md
@@ -5,7 +5,7 @@ To generate this documentation:
1. Install `Node.js` and `npm`
2. Run:
```console
- git clone https://github.com/posativ/isso && cd isso
+ git clone https://github.com/isso-comments/isso && cd isso
make apidoc-init apidoc
```
3. View API documentation in browser at `./apidoc/_output/index.html`:
diff --git a/apidoc/header.md b/apidoc/header.md
index e2cb4efc0..e61458e60 100644
--- a/apidoc/header.md
+++ b/apidoc/header.md
@@ -14,13 +14,13 @@ This is the API documentation of the Isso commenting system.
### Technical details
These API docs are automatically generated by [apiDoc][apidoc] from
-[isso/views/comments.py](https://github.com/posativ/isso/blob/master/isso/views/comments.py).
+[isso/views/comments.py](https://github.com/isso-comments/isso/blob/master/isso/views/comments.py).
You can select previous versions from a dropdown on the upper right of the
page.
For more information about Isso, visit **[isso-comments.de](https://isso-comments.de)**
-or check out the source at **[GitHub](https://github.com/posativ/isso)**.
+or check out the source at **[GitHub](https://github.com/isso-comments/isso)**.
[apiDoc]: https://apidocjs.com/
diff --git a/contrib/dump_comments.py b/contrib/dump_comments.py
index 570d67594..cb2cc13b5 100755
--- a/contrib/dump_comments.py
+++ b/contrib/dump_comments.py
@@ -34,7 +34,7 @@
contrib/dump_comments.py --help
By installing the optional colorama dependency, you'll get a colored output.
-An example of output can be found at https://github.com/posativ/isso/issues/634
+An example of output can be found at https://github.com/isso-comments/isso/issues/634
"""
import argparse
diff --git a/docs/community.rst b/docs/community.rst
index bbb6e479e..6f48e7db4 100644
--- a/docs/community.rst
+++ b/docs/community.rst
@@ -9,7 +9,7 @@ Getting in contact
------------------
The main place of interaction for the Isso community is the
-`GitHub issue tracker `_.
+`GitHub issue tracker `_.
A few people - including the lead developers and maintainers - frequent the
``#isso`` channel, which you can join via
@@ -17,7 +17,7 @@ A few people - including the lead developers and maintainers - frequent the
`Libera.Chat `_
You may also ask questions or suggest improvements on
-`GitHub Discussions `_.
+`GitHub Discussions `_.
.. _scripts-and-helpers:
@@ -26,7 +26,7 @@ Scripts & Helpers
Some utility scripts have been developed by isso users.
They are stored in the `GitHub contrib/ directory
-`_ :
+`_ :
* `dump_comments.py` : dump isso comments as text, optionally with color
* `import_blogger.py` : comment importer from Blogger
@@ -37,7 +37,7 @@ Powered by Isso
---------------
A list of websites and people that use Isso can be found at
-`the wiki at GitHub `_.
+`the wiki at GitHub `_.
Feel free to add your own project to the list!
@@ -53,7 +53,7 @@ like Hugo, Ghost or Pelican.*
- Remember to add last updated timestamp (mon/year) to each new/updated article
- Only publicly keep most relevant articles/tutorials here, the rest can
stay as commented-out ones to avoid duplicates (see list below)
- - Migration complete from https://github.com/posativ/isso/wiki/Tutorials,
+ - Migration complete from https://github.com/isso-comments/isso/wiki/Tutorials,
wiki page deleted
* `Add comments to a static blog with Isso `_ (1/2020)
@@ -129,7 +129,7 @@ Some popular options are:
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/contributing/documentation.rst b/docs/docs/contributing/documentation.rst
index af4423f03..554e5cfc3 100644
--- a/docs/docs/contributing/documentation.rst
+++ b/docs/docs/contributing/documentation.rst
@@ -11,7 +11,7 @@ participating.
written or click the top right **"Edit on GitHub"** button to directly edit
a page.
-.. _docs/: https://github.com/posativ/isso/tree/master/docs
+.. _docs/: https://github.com/isso-comments/isso/tree/master/docs
Sections covered in this document:
@@ -251,7 +251,7 @@ Then visit ``localhost:8000``
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/contributing/index.rst b/docs/docs/contributing/index.rst
index b74b8bfae..c8962d08a 100644
--- a/docs/docs/contributing/index.rst
+++ b/docs/docs/contributing/index.rst
@@ -17,12 +17,12 @@ Report issues
-------------
You are welcome report issues at the
-`GitHub Issue tracker `_.
+`GitHub Issue tracker `_.
If you need help or want to request a feature, please `open a discussion`__
instead. For more ways to get in contact, see the :doc:`/community` page.
-.. __: https://github.com/posativ/isso/discussions
+.. __: https://github.com/isso-comments/isso/discussions
Here are a few general rules to keep in mind when reporting issues:
@@ -50,8 +50,8 @@ referece and open a Pull Request.
You may notice some "weird" newlines in translations -- that's the separator
for pluralforms_ in the templating engine.
-.. __: https://github.com/posativ/isso/blob/master/isso/js/app/i18n/en.js
-.. __: https://github.com/posativ/isso/blob/master/isso/js/app/i18n/
+.. __: https://github.com/isso-comments/isso/blob/master/isso/js/app/i18n/en.js
+.. __: https://github.com/isso-comments/isso/blob/master/isso/js/app/i18n/
.. _pluralforms: http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms
.. _contribute-docs:
@@ -113,9 +113,9 @@ For example, this a **good commit:**
- https://www.maxability.co.in/2016/01/03/placeholder-attribute-and-why-it-is-not-accessible/
This commit is a reland of
- https://github.com/posativ/isso/pull/356 with a fix for the
+ https://github.com/isso-comments/isso/pull/356 with a fix for the
placeholder-replacement code in `isso.js` as reported in
- https://github.com/posativ/isso/issues/524
+ https://github.com/isso-comments/isso/issues/524
...while this is a **bad commit:**
@@ -195,23 +195,23 @@ What is currently needed?
well thought-out opinion
- Look at `milestones`__ - the next release of Isso will be version 0.13, and
you can help by looking for open issues and PRs that
- `contribute to 0.13 `_
+ `contribute to 0.13 `_
- Nicer automated testing, via docker or GH actions, of most of the available
setup options (fastcgi/proxy configs, docker, apachge/nginx, ...)
@posativ's wishlist:
-- `Admin Web Interface `_ –
+- `Admin Web Interface `_ –
administration via email is cumbersome with a high amount of comments. A
administration web interface should include the ability to:
- Delete or activate comments matching a filter (e.g. name, email, ip address)
- Close threads and remove threads completely
-.. __: https://github.com/posativ/isso/labels/needs-contributor
-.. __: https://github.com/posativ/isso/labels/good-first-issue
-.. __: https://github.com/posativ/isso/labels/needs-decision
-.. __: https://github.com/posativ/isso/milestones
+.. __: https://github.com/isso-comments/isso/labels/needs-contributor
+.. __: https://github.com/isso-comments/isso/labels/good-first-issue
+.. __: https://github.com/isso-comments/isso/labels/needs-decision
+.. __: https://github.com/isso-comments/isso/milestones
Regarding fancy new CI tools
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/docs/guides/faq.rst b/docs/docs/guides/faq.rst
index 2eddf33c0..7878a0a2e 100644
--- a/docs/docs/guides/faq.rst
+++ b/docs/docs/guides/faq.rst
@@ -31,7 +31,7 @@ In germany, Isso `is also pokémon N° 360`__.
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/guides/tips-and-tricks.rst b/docs/docs/guides/tips-and-tricks.rst
index 466ea46d8..8b8227edf 100644
--- a/docs/docs/guides/tips-and-tricks.rst
+++ b/docs/docs/guides/tips-and-tricks.rst
@@ -139,13 +139,13 @@ As suggested by `Joshua Gleitze`_:
Use `isso-to-disqus.py `_ and see
other options as discussed in `this issue`_.
-.. _Joshua Gleitze: https://github.com/posativ/isso/issues/186#issuecomment-223550325
-.. _this issue: https://github.com/posativ/isso/issues/186
+.. _Joshua Gleitze: https://github.com/isso-comments/isso/issues/186#issuecomment-223550325
+.. _this issue: https://github.com/isso-comments/isso/issues/186
Pretty-print entire comments database
-------------------------------------
-.. Migration complete from https://github.com/posativ/isso/wiki/Tips-&-tricks
+.. Migration complete from https://github.com/isso-comments/isso/wiki/Tips-&-tricks
The following bash function pretty-print the entire comments DB sorted by
insertion date.
@@ -210,7 +210,7 @@ Add the following CSS to your site to change that color (replace ``#3f3c1c`` wit
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/guides/troubleshooting.rst b/docs/docs/guides/troubleshooting.rst
index f18b0198b..f0b8fb978 100644
--- a/docs/docs/guides/troubleshooting.rst
+++ b/docs/docs/guides/troubleshooting.rst
@@ -47,5 +47,5 @@ The web console shows 404 Not Found responses
Isso returned "404 Not Found" to indicate "No comments" in versions prior to
0.12.3. This behaviour was changed in
-`a pull request `_ to return a code
+`a pull request `_ to return a code
of "200" with an empty array.
diff --git a/docs/docs/reference/client-config.rst b/docs/docs/reference/client-config.rst
index e69d2a69b..891e2abc7 100644
--- a/docs/docs/reference/client-config.rst
+++ b/docs/docs/reference/client-config.rst
@@ -41,7 +41,7 @@ english translation of the ``postbox-notification`` message, you could add:
data-isso-postbox-notification-text-en="Select to be notified of replies to your comment"
-.. __: https://github.com/posativ/isso/blob/master/isso/js/app/i18n/en.js
+.. __: https://github.com/isso-comments/isso/blob/master/isso/js/app/i18n/en.js
data-isso-* directives
------------------------
@@ -97,7 +97,7 @@ data-isso-lang
You can find a list of all supported languages by browsing the
`i18n directory
- `_ of
+ `_ of
the source tree.
Default: ``null``
diff --git a/docs/docs/reference/installation.rst b/docs/docs/reference/installation.rst
index e298d07e6..302083c74 100644
--- a/docs/docs/reference/installation.rst
+++ b/docs/docs/reference/installation.rst
@@ -191,7 +191,7 @@ Get a fresh copy of Isso:
.. code-block:: console
- $ git clone https://github.com/posativ/isso.git
+ $ git clone https://github.com/isso-comments/isso.git
$ cd isso/
To create a virtual environment (recommended), run:
@@ -233,7 +233,7 @@ don't use FastCGi or uWSGI:
- SysVinit (Isso + Gunicorn): https://salsa.debian.org/jelmer/isso/-/blob/master/debian/isso.init
- OpenBSD: https://gist.github.com/noqqe/7397719
- FreeBSD: https://gist.github.com/ckoepp/52f6f0262de04cee1b88ef4a441e276d
-- Supervisor: https://github.com/posativ/isso/issues/47
+- Supervisor: https://github.com/isso-comments/isso/issues/47
If you're writing your own init script, you can utilize ``start-stop-daemon``
to run Isso in the background (Isso runs in the foreground usually). Below you
diff --git a/docs/docs/reference/server-api.rst b/docs/docs/reference/server-api.rst
index f9bf274c2..ae56878ce 100644
--- a/docs/docs/reference/server-api.rst
+++ b/docs/docs/reference/server-api.rst
@@ -19,7 +19,7 @@ API is extensively documented using an `apiDoc`_-compatible syntax in
.. _Current API documentation: /docs/api/
.. _apiDoc: https://apidocjs.com/
-.. _isso/views/comments.py: https://github.com/posativ/isso/blob/master/isso/views/comments.py
+.. _isso/views/comments.py: https://github.com/isso-comments/isso/blob/master/isso/views/comments.py
Sections covered in this document:
diff --git a/docs/docs/reference/server-config.rst b/docs/docs/reference/server-config.rst
index 833bd6bbd..ea3c91d8a 100644
--- a/docs/docs/reference/server-config.rst
+++ b/docs/docs/reference/server-config.rst
@@ -3,7 +3,7 @@ Server Configuration
The Isso configuration file is an `INI-style`__ textfile. It reads integers,
booleans, strings and lists. Here's the default isso configuration:
-`isso.cfg `_. A
+`isso.cfg `_. A
basic configuration from scratch looks like this:
.. code-block:: ini
@@ -255,7 +255,7 @@ samesite
By default, isso will set ``SameSite=None`` when served over https and
``SameSite=Lax`` when served over http
(see `MDM: SameSite `_
- and `#682 `_ for details).
+ and `#682 `_ for details).
Accepted values: ``None``, ``Lax``, ``Strict``
@@ -445,7 +445,7 @@ allowed-elements
still allowed. You can only add *additional* elements here.
It is planned to change this behavior, see
- `this issue `_.
+ `this issue `_.
Default: (empty)
diff --git a/docs/docs/technical-docs/client.rst b/docs/docs/technical-docs/client.rst
index c99ecc696..5f85815c7 100644
--- a/docs/docs/technical-docs/client.rst
+++ b/docs/docs/technical-docs/client.rst
@@ -7,7 +7,7 @@ Technical Documentation: Client
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/technical-docs/server.rst b/docs/docs/technical-docs/server.rst
index 6918a64d0..9bf10638f 100644
--- a/docs/docs/technical-docs/server.rst
+++ b/docs/docs/technical-docs/server.rst
@@ -17,7 +17,7 @@ Isso uses some of the following dependencies:
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/technical-docs/testing-client.rst b/docs/docs/technical-docs/testing-client.rst
index 39cf244b5..f42436e42 100644
--- a/docs/docs/technical-docs/testing-client.rst
+++ b/docs/docs/technical-docs/testing-client.rst
@@ -208,7 +208,7 @@ Then commit those generated ``.hash`` files in
older Ubuntu versions - another reason to stick to the Docker environment
for consistency.
-.. _integration tests folder: https://github.com/posativ/isso/tree/master/isso/js/tests/screenshots
+.. _integration tests folder: https://github.com/isso-comments/isso/tree/master/isso/js/tests/screenshots
Testing standards
-----------------
@@ -288,7 +288,7 @@ Make a new commit for the changes to the snapshot - here's an example:
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/technical-docs/testing-server.rst b/docs/docs/technical-docs/testing-server.rst
index f2006654f..e982f4871 100644
--- a/docs/docs/technical-docs/testing-server.rst
+++ b/docs/docs/technical-docs/testing-server.rst
@@ -37,7 +37,7 @@ Generate and view server **test coverage**:
.. note::
The Continuous Integration suite running via
- `GitHub Actions `_
+ `GitHub Actions `_
will throw an **error** if either the unit tests, the integration tests or
the ``flake8`` tests fail or the code coverage falls **below 70%**.
@@ -74,7 +74,7 @@ development directory).
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/docs/technical-docs/testing.rst b/docs/docs/technical-docs/testing.rst
index da2720bdf..ce19034f3 100644
--- a/docs/docs/technical-docs/testing.rst
+++ b/docs/docs/technical-docs/testing.rst
@@ -11,7 +11,7 @@ aware of (this is called "test coverage"). For more information, see
The **Javascript client** code is covered by both unit tests and end-to-end
integration tests. The test coverage is very small at the moment - see
-`this GitHub issue `_.
+`this GitHub issue `_.
For detailed instructions about running client tests, see
:doc:`testing-client`.
@@ -58,7 +58,7 @@ a requirement, but can make a few tests faster to set up, makes automation
easier and ensures a consistent testing environment across developer machines.
Isso ships with several ``Dockerfiles`` - the ones under the
-`docker/ folder `_ are for
+`docker/ folder `_ are for
creating a container that can run the unit and integration tests.
Build images
@@ -190,7 +190,7 @@ Be a chaos monkey! Think of unconventional ways of breaking Isso.
Click the ``Edit on GitHub`` button in the top right corner and read the
GitHub Issue named
- `Improve & Expand Documentation `_
+ `Improve & Expand Documentation `_
for further information.
**What's missing?**
diff --git a/docs/index.html b/docs/index.html
index 1a9ed453f..9cbd99db4 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -42,13 +42,13 @@
Links
Help
Join #isso
via Matrix
or via IRC on Libera.Chat,
- or ask a question on GitHub Discussions.
+ or ask a question on GitHub Discussions.
Contribute
diff --git a/isso/db/comments.py b/isso/db/comments.py
index 603799243..9bed6f0b5 100644
--- a/isso/db/comments.py
+++ b/isso/db/comments.py
@@ -38,7 +38,7 @@ def __init__(self, db):
'CREATE TABLE IF NOT EXISTS comments (',
' tid REFERENCES threads(id), id INTEGER PRIMARY KEY, parent INTEGER,',
' created FLOAT NOT NULL, modified FLOAT, mode INTEGER, remote_addr VARCHAR,',
- ' text VARCHAR, author VARCHAR, email VARCHAR, website VARCHAR,',
+ ' text VARCHAR NOT NULL, author VARCHAR, email VARCHAR, website VARCHAR,',
' likes INTEGER DEFAULT 0, dislikes INTEGER DEFAULT 0, voters BLOB NOT NULL,',
' notification INTEGER DEFAULT 0);'])
try:
diff --git a/isso/isso.cfg b/isso/isso.cfg
index 3827a61bb..fec238296 100644
--- a/isso/isso.cfg
+++ b/isso/isso.cfg
@@ -127,7 +127,7 @@ trusted-proxies =
# By default, isso will set SameSite=None when served over https and
# SameSite=Lax when served over http.
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
-# and https://github.com/posativ/isso/issues/682
+# and https://github.com/isso-comments/isso/issues/682
# Accepted values: None, Lax, Strict
samesite =
diff --git a/isso/js/app/api.js b/isso/js/app/api.js
index 86a01092e..90efa4926 100644
--- a/isso/js/app/api.js
+++ b/isso/js/app/api.js
@@ -22,7 +22,7 @@ if (! endpoint) {
for (i = 0; i < js.length; i++) {
if (js[i].getAttribute("async") || js[i].getAttribute("defer")) {
throw "Isso's automatic configuration detection failed, please " +
- "refer to https://github.com/posativ/isso#client-configuration " +
+ "refer to https://github.com/isso-comments/isso#client-configuration " +
"and add a custom `data-isso` attribute.";
}
}
diff --git a/isso/js/tests/unit/template-comment-newlines.test.js b/isso/js/tests/unit/template-comment-newlines.test.js
index 3a5943f78..00afe5a45 100644
--- a/isso/js/tests/unit/template-comment-newlines.test.js
+++ b/isso/js/tests/unit/template-comment-newlines.test.js
@@ -10,8 +10,8 @@
"use strict";
/* Test rendered code blocks inside "comment" template
- * See https://github.com/posativ/isso/discussions/856
- * and https://github.com/posativ/isso/pull/857
+ * See https://github.com/isso-comments/isso/discussions/856
+ * and https://github.com/isso-comments/isso/pull/857
*/
// Set up our document body
diff --git a/isso/migrate.py b/isso/migrate.py
index 038c910e4..5123c4327 100644
--- a/isso/migrate.py
+++ b/isso/migrate.py
@@ -92,10 +92,11 @@ def migrate(self):
for post in tree.findall(Disqus.ns + 'post'):
email = post.find('{0}author/{0}email'.format(Disqus.ns))
ip = post.find(Disqus.ns + 'ipAddress')
+ comment_text = post.find(Disqus.ns + 'message').text or ''
item = {
'dsq:id': post.attrib.get(Disqus.internals + 'id'),
- 'text': post.find(Disqus.ns + 'message').text,
+ 'text': comment_text,
'author': post.find('{0}author/{0}name'.format(Disqus.ns)).text,
'email': email.text if email is not None else '',
'created': mktime(strptime(
@@ -146,11 +147,13 @@ def migrate(self):
continue
email = post.find("{0}author/{0}email".format(Disqus.ns))
+ comment_text = post.find(Disqus.ns + 'message').text or ''
+
print(" * {0} by {1} <{2}>".format(
post.attrib.get(Disqus.internals + "id"),
post.find("{0}author/{0}name".format(Disqus.ns)).text,
email.text if email is not None else ""))
- print(textwrap.fill(post.find(Disqus.ns + "message").text,
+ print(textwrap.fill(comment_text,
initial_indent=" ", subsequent_indent=" "))
print("")
diff --git a/isso/tests/disqus.xml b/isso/tests/disqus.xml
index 6475270a7..d8d09740c 100644
--- a/isso/tests/disqus.xml
+++ b/isso/tests/disqus.xml
@@ -79,7 +79,7 @@
+ reported by waqqasdadabhoy in https://github.com/isso-comments/isso/issues/728 -->
redacted
@@ -113,4 +113,37 @@
+
+
+
+
+ 2013-10-10T19:20:29Z
+ true
+ false
+
+ foo@bar.com
+ peter
+ true
+
+ 127.0.0.1
+
+
+
+
+
+ Hello, World.
]]>
+ 2013-10-11T06:52:33Z
+ false
+ false
+
+ foo@bar.com
+ user
+ false
+ user
+
+ 127.0.0.1
+
+
+
+
diff --git a/isso/tests/test_html.py b/isso/tests/test_html.py
index 5b59b39a2..5d5f87a39 100644
--- a/isso/tests/test_html.py
+++ b/isso/tests/test_html.py
@@ -70,6 +70,8 @@ def test_sanitizer(self):
('ld.so', 'ld.so'),
('/usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so', '/usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so'),
('Test
', 'Test
'),
+ ('Test
', 'Test
'),
+ ('Test
', 'Test
'),
('', 'alert("Onoe")')]
for (input, expected) in examples:
@@ -122,7 +124,7 @@ def test_code_blocks(self):
convert = html.Markdown(extensions=('fenced-code',))
examples = [
("```\nThis is a code-fence. \n```", "This is a code-fence. <hello>\n
"),
- ("```c++\nThis is a code-fence. \n```", "This is a code-fence. <hello>\n
"),
+ ("```cpp\nThis is a code-fence. \n```", "This is a code-fence. <hello>\n
"),
(" This is a four-character indent. ", "This is a four-character indent. <hello>\n
")]
for (input, expected) in examples:
diff --git a/isso/tests/test_migration.py b/isso/tests/test_migration.py
index ff5f55f05..78fc68443 100644
--- a/isso/tests/test_migration.py
+++ b/isso/tests/test_migration.py
@@ -56,7 +56,7 @@ def test_disqus_empty_id_workaround(self):
Disqus(db, xml, empty_id=True).migrate()
self.assertEqual(
- len(db.execute("SELECT id FROM comments").fetchall()), 3)
+ len(db.execute("SELECT id FROM comments").fetchall()), 5)
self.assertEqual(db.threads["/"]["title"], "Hello, World!")
self.assertEqual(db.threads["/"]["id"], 1)
@@ -67,9 +67,12 @@ def test_disqus_empty_id_workaround(self):
self.assertEqual(a["email"], "foo@bar.com")
self.assertEqual(a["remote_addr"], "127.0.0.0")
- b = db.comments.get(2)
+ b = db.comments.get(3)
self.assertEqual(b["parent"], a["id"])
+ deleted_comment = db.comments.get(2)
+ self.assertEqual(deleted_comment["text"], "")
+
def test_wordpress(self):
xml = join(dirname(__file__), "wordpress.xml")
diff --git a/isso/utils/html.py b/isso/utils/html.py
index b7b895d20..c1aafad1a 100644
--- a/isso/utils/html.py
+++ b/isso/utils/html.py
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
import html
+import re
import bleach
import misaka
@@ -8,6 +9,13 @@
class Sanitizer(object):
+ # pattern to match a valid class attribute for code tags
+ code_language_pattern = re.compile(r"^language-[a-zA-Z0-9]{1,20}$")
+
+ @staticmethod
+ def allow_attribute_class(tag, name, value):
+ return name == "class" and bool(Sanitizer.code_language_pattern.match(value))
+
def __init__(self, elements, attributes):
# attributes found in Sundown's HTML serializer [1]
# - except for
tag, because images are not generated anyways.
@@ -20,8 +28,13 @@ def __init__(self, elements, attributes):
"h1", "h2", "h3", "h4", "h5", "h6", "sub", "sup",
"table", "thead", "tbody", "th", "td"] + elements
- # href for and align for
- self.attributes = ["align", "href"] + attributes
+ # allowed attributes for tags
+ self.attributes = {
+ "table": ["align"],
+ "a": ["href"],
+ "code": Sanitizer.allow_attribute_class,
+ "*": attributes
+ }
def sanitize(self, text):
clean_html = bleach.clean(text, tags=self.elements, attributes=self.attributes, strip=True)
@@ -73,11 +86,11 @@ class Unofficial(misaka.HtmlRenderer):
For instance, fenced code blocks (~~~ or ```) are just wrapped in
which does not preserve line breaks. If a language is given, it is added
- to , compatible with Highlight.js.
+ to , compatible with Highlight.js.
"""
def blockcode(self, text, lang):
- lang = ' class="{0}"'.format(html.escape(lang)) if lang else ''
+ lang = ' class="language-{0}"'.format(html.escape(lang)) if lang else ''
return "{0}
\n".format(html.escape(text, False), lang)
diff --git a/package.json b/package.json
index ad2f2e2ff..1e7f9d7f8 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"author": "Martin Zimmermann",
"description": "lightweight Disquis alternative",
"license": "MIT",
- "repository": "github:posativ/isso",
+ "repository": "github:isso-comments/isso",
"scripts": {
"test": "jest --config isso/js/jest.config.js isso/js/tests/",
"test-unit": "jest --config isso/js/jest-unit.config.js isso/js/tests/unit/",
diff --git a/setup.py b/setup.py
index 868207783..882f9d71d 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
packages=find_packages(),
include_package_data=True,
zip_safe=False,
- url='https://github.com/posativ/isso/',
+ url='https://github.com/isso-comments/isso/',
license='MIT',
description='lightweight Disqus alternative',
long_description=long_description,