How to use HTML formatting with telegra.ph API

I use telegra.ph api to edit the page I made. I want to format the text that I have on the page for alignment to the right of the page. Currently, the content I'm submitting through a Python request:

from telegraph import Telegraph
tel = Telegraph(my_access_token)

content = [{"tag": "h4",
            "children": ["Hello, World!"]},
            "attrs": {"dir": "rtl"}
            }]

page = tel.edit_page(path='/url',
                     title='testing',
                     content=content,
                     )

However, the request completely ignores the attribute "dir": "rtl", since dir is not one of the attributes that Telegraph accepts. How to align text right through telegra.ph?

+4
source share
2 answers

HTML , .

,

+2

, - , , / . / , / , .

+1

Source: https://habr.com/ru/post/1678731/


All Articles