Commit Graph

2769 Commits

Author SHA1 Message Date
Dan
e61bf92627 Add Parser package
Revamped from HTML/Markdown
2019-06-26 16:07:27 +02:00
Dan
be5f0c9529 Parser's client can be None
In that case, check if is None and don't parse user mentions.
This happens only in text content for inline results
2019-06-26 16:06:50 +02:00
Dan
8d852cb47e Implement strict and loose markdown parsing
This is enabled by default:

  - strict: only markdown syntax is parsed
  - loose: both markdown and html syntax are parsed
2019-06-26 16:05:09 +02:00
Dan
e4a6d16cf3 Remove generated inline query result types 2019-06-26 15:56:08 +02:00
Dan
7490f6cfa3 Update the HTML parser: make it easy for asyncio to deal with mentions
We can't await coroutines inside HTMLParser overridden methods, such as
handle_starttag, because they can't be async. This commit moves the
resolve_peer call into the parse method of the HTML class, which can be
defined async.
2019-06-25 11:47:45 +02:00
Dan
32ca805f6b Update message.py 2019-06-25 10:25:21 +02:00
Dan
168fce09da Implement HTML.unparse and Markdown.unparse 2019-06-25 10:24:19 +02:00
Dan
a086964e85 Make the HTML parser more sound 2019-06-25 07:41:48 +02:00
Dan
07bc7e39df Allow entities to overlap, like: <b>bold <i>and</b> italic</i> 2019-06-25 07:08:38 +02:00
Dan
df386b2f91 Make slicing text messages & captions work properly with entity offsets 2019-06-25 05:53:41 +02:00
Dan
de02848a69 Revert "Delete style utils.py and move its content inside html.py The HTML parser is now the only one that makes use of those util methods"
This reverts commit cd1e41b1
2019-06-25 05:47:57 +02:00
Dan
cd1e41b130 Delete style utils.py and move its content inside html.py
The HTML parser is now the only one that makes use of those util methods
2019-06-24 14:33:17 +02:00
Dan
e7457de947 Add MSGID_DECREASE_RETRY 5xx-class error 2019-06-24 14:25:09 +02:00
Dan
a27dc575e4 Actually fix the HTML Parser feeding by calling .close() when done 2019-06-24 14:17:46 +02:00
Dan
cac0bcabf9 Fix HTML parsing breaking with no tags 2019-06-24 13:36:27 +02:00
Dan
8e0182633f Ignore any other style when inside a fixed-width style 2019-06-24 13:35:58 +02:00
Dan
f12cee5d94 Automatically escape URL bodies when using markdown 2019-06-24 10:54:58 +02:00
Dan
d6900cde9f Remove debug print() 2019-06-24 10:11:21 +02:00
Dan
fe611a3344 Merge remote-tracking branch 'origin/develop' into develop 2019-06-24 10:08:07 +02:00
Dan
e7c49c6a1b Revamp HTML and Markdown parsers to allow multiple nested entities 2019-06-24 10:07:28 +02:00
Dan
8102a7fe82
Update FUNDING.yml 2019-06-24 01:46:20 +02:00
Dan
648f37cf6d Add support for underline and strikethrough text via Markdown
New delimiters:

    - ~~strikethrough~~
    - --underline--
2019-06-23 22:43:11 +02:00
Dan
978ee4e6a6 Add new message entity types: "underline", "strike" and "blockquote" 2019-06-23 22:32:45 +02:00
Dan
0985d7ad90 Enable parsing underline, strikethrough and blockquote text for HTML 2019-06-23 22:31:55 +02:00
Dan
4dbdfc85d7 Update API schema to Layer 102 2019-06-23 20:45:19 +02:00
Dan
745d29dfac Add (and update) a bunch of up/download related errors 2019-06-23 03:02:29 +02:00
Dan
5f2d76ceca Remove outdated note 2019-06-23 01:34:27 +02:00
Dan
31f39a00ab Make plugin callback functions return the function itself when decorated 2019-06-23 01:33:46 +02:00
Dan
b4f0f411bd Small documentation fixes 2019-06-23 01:32:04 +02:00
Dan
bf71989bd0 Enhance PDF building 2019-06-23 01:31:18 +02:00
Dan
267797051c Fix broken link 2019-06-23 01:30:50 +02:00
Dan
91e377aacc Add ARTICLE_TITLE_EMPTY error 2019-06-23 01:30:38 +02:00
Dan
e7fffd2f76 Fix workers not running concurrently anymore after using a shared Lock 2019-06-22 00:45:49 +02:00
Dan
b439e44015 Fix tiny typo 2019-06-21 03:43:43 +02:00
Dan
a398bc5fc7 Rename CallbackQuery's bound-methods: edit_* -> edit_message_* 2019-06-21 02:00:29 +02:00
Dan
8d0e161b56 Lock dispatcher groups. Fixes #255 2019-06-21 01:53:17 +02:00
Dan
0699bd31e5 Bring Message .reply() and .edit() back for now 2019-06-20 19:23:33 +02:00
Dan
11b4b947ac Small rewords 2019-06-20 16:40:12 +02:00
Dan
83900f398f Specify that 3.5.3 or higher is required for asyncio 2019-06-20 16:10:18 +02:00
Dan
a928981b1f Link back to the source of information, where applicable 2019-06-20 16:07:57 +02:00
Dan
d06289c88d Add FAQ about why responses might be slow 2019-06-20 15:31:02 +02:00
Dan
81e7c1b4eb Add START_PARAM_INVALID error 2019-06-20 14:15:53 +02:00
Dan
9ebf2983fe Cast Paths to string: pathlib for older pythons doesn't properly work 2019-06-20 14:15:02 +02:00
Dan
48197cb222 Update FAQ: Starting from v0.14.1 photo-like file id formats changed 2019-06-20 13:56:23 +02:00
Dan
36757c125c Tiny documentation fix 2019-06-20 13:55:05 +02:00
Dan
ad2d45bca1 Add BUTTON_DATA_INVALID error 2019-06-20 13:54:46 +02:00
Dan
f16ca8b9ea Small documentation fixes 2019-06-20 03:39:12 +02:00
Dan
8c96e5f46a Smarter session migration 2019-06-20 03:31:37 +02:00
Dan
fa1976c8a0 Update TgCrypto required version 2019-06-19 17:09:07 +02:00
Dan
2ff74270ad
Merge pull request #220 from bakatrouble/session_storage
Implement extendable session storage, move to SQLite as main storage (WIP)
2019-06-19 16:12:36 +02:00