PlaidWeb / Publ

Flexible publishing system for the web
http://publ.beesbuzz.biz/
MIT License
40 stars 4 forks source link

Entry.raw_text function #553

Open fluffy-critter opened 1 year ago

fluffy-critter commented 1 year ago

Expected Behavior

It would be extremely useful to have a raw_text property on entries, to be able to more efficiently do things like:

{% if 'amzn.to' in entry.raw_text %}Some links may earn me a commission.{% endif %}

or the like.

Current Behavior

You can only do string manipulation on the already-processed entry body + more, which requires more processing that will just be discarded, especially for entries which have images.

Possible Solution

class Entry:
   ...
   @cached_property
   def raw_text(self):
      return self._message.get_payload()

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context