Skip to content

HTML to Markdown support#1638

Open
caronc wants to merge 8 commits into
masterfrom
1600-html-to-markdown
Open

HTML to Markdown support#1638
caronc wants to merge 8 commits into
masterfrom
1600-html-to-markdown

Conversation

@caronc

@caronc caronc commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Description

Related issue (if applicable): #1600

This implements a proper HTML-to-Markdown converter for Apprise, completing the work started in PR #932.

The converter now emits structured Markdown instead of falling back to plain-text extraction when a Markdown-capable notification service receives HTML input. This is also a starting marker for the broader #1600 effort, which extends beyond this PR.

Element Output
<h1><h6> ####### prefixed line
<b>, <strong> **text**
<em>, <i> *text*
<code> `text` inline code
<pre>, <samp> fenced code block
<a href="…"> [text](<url>)
<a> without href plain text
<blockquote> > text
<ul>, <ol>, <li> Markdown lists
<hr> ---
<br> Markdown hard line break
<table>, <thead>, <tbody>, <tr>, <th>, <td> Markdown table
Markdown-sensitive text characters escaped where needed
<script>, <style>, <head>, etc. suppressed

Docs: caronc/apprise-docs#89

Checklist

  • Documentation ticket created (if applicable): n/a
  • The change is tested and works locally.
  • No commented-out code in this PR.
  • No lint errors (use tox -e lint and optionally tox -e format).
  • Test coverage added or updated (use tox -e qa).

Testing

Anyone can help test as follows:

# Create a virtual environment
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@1600-html-to-markdown

# Send HTML to a Markdown-capable service
apprise -t "Test Title" \
  -b '<h1>Hello</h1><p>This is <b>bold</b>, <i>italic</i>, and <a href="https://github.com/caronc/apprise">linked</a>.</p>' \
  --format html \
  '<apprise url that supports markdown, e.g. gotify://...>'

If you have cloned the branch and have tox available:

tox -e lint
tox -e qa

tox -e apprise -- -t "Test Title" \
  -b '<p>This is <b>HTML</b> converted to Markdown.</p>' \
  --format html \
  '<apprise url that supports markdown, e.g. gotify://...>'

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.82563% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.99%. Comparing base (b594187) to head (6f709e2).

Files with missing lines Patch % Lines
apprise/utils/format.py 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master    #1638      +/-   ##
===========================================
- Coverage   100.00%   99.99%   -0.01%     
===========================================
  Files          214      214              
  Lines        30305    31438    +1133     
  Branches      5049     5333     +284     
===========================================
+ Hits         30305    31436    +1131     
- Misses           0        1       +1     
- Partials         0        1       +1     
Files with missing lines Coverage Δ
apprise/conversion.py 100.00% <100.00%> (ø)
apprise/plugins/base.py 100.00% <100.00%> (ø)
apprise/plugins/evolution.py 100.00% <100.00%> (ø)
apprise/plugins/google_chat.py 100.00% <100.00%> (ø)
apprise/plugins/slack.py 100.00% <100.00%> (ø)
apprise/plugins/splunk.py 100.00% <ø> (ø)
apprise/plugins/telegram.py 100.00% <100.00%> (ø)
apprise/utils/format.py 97.46% <88.23%> (-2.54%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caronc caronc force-pushed the 1600-html-to-markdown branch from e77b693 to 3187298 Compare June 14, 2026 18:36
@caronc caronc force-pushed the 1600-html-to-markdown branch 5 times, most recently from ac18bee to a674413 Compare June 22, 2026 22:17
@caronc caronc force-pushed the 1600-html-to-markdown branch 7 times, most recently from a84faba to 4a09ca3 Compare June 28, 2026 03:01
@caronc caronc force-pushed the 1600-html-to-markdown branch from 4a09ca3 to 6f709e2 Compare June 28, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant