【问题标题】:Formatting lists in Telegraph APITelegraph API 中的格式化列表
【发布时间】:2021-11-25 23:46:09
【问题描述】:

在一个系统上工作,包括通过 python 在 Telegraph 上发布文章。 一般来说,一切正常。但最近我发现

    标签在不同浏览器中的奇怪行为。在 Telegraph 的移动版本上,它按预期工作,而在其他任何地方都没有。除了对行数进行硬编码外,还有其他解决方案吗? 您可以在这里自行查看https://telegra.ph/Arthur-Conan-Doyle-Estudio-en-Escarlata-1-09-06(自 2021 年 10 月 5 日起生效)。 我使用的代码如下:
def update_page(path, title, content, author):
  response = telegraph.edit_page(path, html_content = content, title = title,
                               author_name = author, return_content=True)
  current_path = 'http://telegra.ph/{}'.format(path)
  return current_path 

html = '''
<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
'''
title = 'Testing lists'
update_page(test_path, title, html, AUTHOR)

行为示例: the behavior I need, mobile version of Telegraph 这是 what I get in Chrome, Firefox and Safari

【问题讨论】:

    标签: python html telegram telegram-bot telegraph


    【解决方案1】:

    尝试将列表项写在一行中,例如

  • 1
  • 2
  • 3
  • 。这为我解决了。

    【讨论】:

    • 确实有效。谢谢!有什么解释或来源吗?
    • @ЮліяЗавальнюк 记得点赞一个有用的答案,如果它对你有帮助就更重要了。让人们(尤其是新手或低记录用户)帮助他人确实很有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-20
    • 2019-09-05
    • 2016-08-20
    • 2013-09-09
    • 2011-04-02
    相关资源
    最近更新 更多