Skip to content

Commit

Permalink
Use ornament quotations for Quotation’s pure_content
Browse files Browse the repository at this point in the history
The result is visually similar to what the web UI uses, and
avoids any ambiguity with common quote characters used by the
quotation itself.

The characters introduced are:

- HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT U+275E
- HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT U+275D
  • Loading branch information
dato committed Sep 17, 2023
1 parent a09b2ab commit 7380a9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bookwyrm/models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ class Quotation(BookStatus):
@property
def pure_content(self):
"""indicate the book in question for mastodon (or w/e) users"""
quote = re.sub(r"^<p>", '<p>"', self.quote)
quote = re.sub(r"</p>$", '"</p>', quote)
quote = re.sub(r"^<p>", "<p>❝", self.quote)
quote = re.sub(r"</p>$", "❞</p>", quote)
if self.position_mode == "PG" and self.position and (self.position > 0):
return_value = (
f'{quote} <p>-- <a href="{self.book.remote_id}">'
Expand Down

0 comments on commit 7380a9d

Please sign in to comment.