From f864dd832c455cff9fbc614c73de9fbc2c30205b Mon Sep 17 00:00:00 2001
From: Daniel Himmelstein
Date: Thu, 18 Feb 2016 21:43:51 -0800
Subject: [PATCH] =?UTF-8?q?Change=20...=20(periods)=20to=20=E2=80=A6=20(el?=
=?UTF-8?q?lipsis)=20in=20summary?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Also update HTML output by running (after making sure to have the fr_FR.utf8
locale installed):
```sh
LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ -s samples/pelican.conf.py samples/content/
LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ -s samples/pelican.conf_FR.py samples/content/
LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ samples/content/
```
as described at
http://docs.getpelican.com/en/3.6.3/contribute.html#running-the-test-suite
---
pelican/tests/output/basic/category/misc.html | 2 +-
pelican/tests/output/basic/index.html | 2 +-
.../custom/author/alexis-metaireau3.html | 2 +-
.../tests/output/custom/category/misc.html | 2 +-
pelican/tests/output/custom/index3.html | 2 +-
.../author/alexis-metaireau3.html | 2 +-
.../output/custom_locale/category/misc.html | 2 +-
.../tests/output/custom_locale/index3.html | 2 +-
pelican/tests/test_utils.py | 34 +++++++++----------
pelican/utils.py | 4 +--
10 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html
index 197ee1d5..0ad46b6c 100644
--- a/pelican/tests/output/basic/category/misc.html
+++ b/pelican/tests/output/basic/category/misc.html
@@ -90,7 +90,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html
index 272ad852..f6d1c7bf 100644
--- a/pelican/tests/output/basic/index.html
+++ b/pelican/tests/output/basic/index.html
@@ -227,7 +227,7 @@ YEAH !
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html
index e53c27ef..e8322d4d 100644
--- a/pelican/tests/output/custom/author/alexis-metaireau3.html
+++ b/pelican/tests/output/custom/author/alexis-metaireau3.html
@@ -59,7 +59,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html
index c798ebac..1cd34ee9 100644
--- a/pelican/tests/output/custom/category/misc.html
+++ b/pelican/tests/output/custom/category/misc.html
@@ -103,7 +103,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html
index ff54fa4c..33d6c193 100644
--- a/pelican/tests/output/custom/index3.html
+++ b/pelican/tests/output/custom/index3.html
@@ -59,7 +59,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html
index bc878499..93a3f6cc 100644
--- a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html
+++ b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html
@@ -59,7 +59,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html
index 2805b745..8ef1af55 100644
--- a/pelican/tests/output/custom_locale/category/misc.html
+++ b/pelican/tests/output/custom_locale/category/misc.html
@@ -103,7 +103,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/output/custom_locale/index3.html b/pelican/tests/output/custom_locale/index3.html
index fbb30f63..217e97a4 100644
--- a/pelican/tests/output/custom_locale/index3.html
+++ b/pelican/tests/output/custom_locale/index3.html
@@ -59,7 +59,7 @@
Testing another case
This will now have a line number in 'custom' since it's the default in
-pelican.conf, it will ...
+pelican.conf, it will …
read more
There are comments.
diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py
index d967b247..fed7e94b 100644
--- a/pelican/tests/test_utils.py
+++ b/pelican/tests/test_utils.py
@@ -152,56 +152,56 @@ class TestUtils(LoggedTestCase):
'short string')
self.assertEqual(
utils.truncate_html_words('word ' * 100, 20),
- 'word ' * 20 + '...')
+ 'word ' * 20 + '…')
# Words enclosed or intervaled by HTML tags.
self.assertEqual(
utils.truncate_html_words('' + 'word ' * 100 + '
', 20),
- '' + 'word ' * 20 + '...
')
+ '' + 'word ' * 20 + '…
')
self.assertEqual(
utils.truncate_html_words(
- '' + 'word ' * 100 + '', 20),
- '' + 'word ' * 20 + '...')
+ '' + 'word ' * 100 + '', 20),
+ '' + 'word ' * 20 + '…')
self.assertEqual(
utils.truncate_html_words('
' + 'word ' * 100, 20),
- '
' + 'word ' * 20 + '...')
+ '
' + 'word ' * 20 + '…')
self.assertEqual(
utils.truncate_html_words('' + 'word ' * 100, 20),
- '' + 'word ' * 20 + '...')
+ '' + 'word ' * 20 + '…')
# Words with hypens and apostrophes.
self.assertEqual(
utils.truncate_html_words("a-b " * 100, 20),
- "a-b " * 20 + '...')
+ "a-b " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("it's " * 100, 20),
- "it's " * 20 + '...')
+ "it's " * 20 + '…')
# Words with HTML entity references.
self.assertEqual(
utils.truncate_html_words("é " * 100, 20),
- "é " * 20 + '...')
+ "é " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("café " * 100, 20),
- "café " * 20 + '...')
+ "café " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("èlite " * 100, 20),
- "èlite " * 20 + '...')
+ "èlite " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("cafetiére " * 100, 20),
- "cafetiére " * 20 + '...')
+ "cafetiére " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("∫dx " * 100, 20),
- "∫dx " * 20 + '...')
+ "∫dx " * 20 + '…')
# Words with HTML character references inside and outside
# the ASCII range.
self.assertEqual(
utils.truncate_html_words("é " * 100, 20),
- "é " * 20 + '...')
+ "é " * 20 + '…')
self.assertEqual(
utils.truncate_html_words("∫dx " * 100, 20),
- "∫dx " * 20 + '...')
+ "∫dx " * 20 + '…')
def test_process_translations(self):
# create a bunch of articles
@@ -378,7 +378,7 @@ class TestUtils(LoggedTestCase):
utils.strftime(d, 'Yayınlanma tarihi: %A, %d %B %Y'),
'Yayınlanma tarihi: Çarşamba, 29 Ağustos 2012')
- # non-ascii format candidate (someone might pass it... for some reason)
+ # non-ascii format candidate (someone might pass it… for some reason)
self.assertEqual(
utils.strftime(d, '%Y yılında %üretim artışı'),
'2012 yılında %üretim artışı')
@@ -413,7 +413,7 @@ class TestUtils(LoggedTestCase):
utils.strftime(d, 'Écrit le %d %B %Y'),
'Écrit le 29 août 2012')
- # non-ascii format candidate (someone might pass it... for some reason)
+ # non-ascii format candidate (someone might pass it… for some reason)
self.assertEqual(
utils.strftime(d, '%écrits en %Y'),
'%écrits en 2012')
diff --git a/pelican/utils.py b/pelican/utils.py
index d2e896c6..b5685a3b 100644
--- a/pelican/utils.py
+++ b/pelican/utils.py
@@ -531,12 +531,12 @@ class _HTMLWordTruncator(HTMLParser):
self.handle_ref(six.unichr(codepoint))
-def truncate_html_words(s, num, end_text='...'):
+def truncate_html_words(s, num, end_text='…'):
"""Truncates HTML to a certain number of words.
(not counting tags and comments). Closes opened tags if they were correctly
closed in the given html. Takes an optional argument of what should be used
- to notify that the string has been truncated, defaulting to ellipsis (...).
+ to notify that the string has been truncated, defaulting to ellipsis (…).
Newlines in the HTML are preserved. (From the django framework).
"""