viiccwen commented on PR #55294:
URL: https://github.com/apache/airflow/pull/55294#issuecomment-3261588331

   Thanks for adding the escaping logic 🙌  
   I ran some tests with a small script and noticed a potential issue:
   
   Currently the hook always escapes text before sending. This means:
   
   - When `parse_mode=HTML`, `<b>Airflow</b>` is escaped to 
`&lt;b&gt;Airflow&lt;/b&gt;`  
     → shows literally instead of rendering as bold.
   - When `parse_mode=MARKDOWN` or `MARKDOWN_V2`, `*bold*` / `_italic_` are 
escaped to `\*bold\*` / `\_italic\_`  
     → shows literally instead of rendering as formatted text.
   
   So effectively, any time a parse mode is **explicitly** provided, the user 
loses the ability to use Telegram’s supported formatting.  
   Escaping is valuable for safety, but applying it unconditionally makes 
`parse_mode` meaningless.
   
   I think you should:
   - Only apply escaping when `parse_mode=None` (plain text).  
   - Or add a flag (e.g. `auto_escape=True`) so advanced users can disable it 
when they intentionally want to use HTML/Markdown formatting.
   
   @jason810496 what's ur opinion?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to