Skip to content

Convert newlines to <br> more judiciously in format_description_to_html

Fixes fdroid-website#889

Some illustrations with examples

App descriptions which are —
(what a carriage return (line break) means in context)

Essentially plain text:
(start the following content on a new line)
eg F-Droid
F-Droid is an installable catalogue of libre software apps for Android. The F-Droid client app makes it easy to browse, install, and keep track of updates on your device.

It connects to any F-Droid compatible repositories. The default repo is hosted at f-droid.org, which contains only bona fide libre software.

Android itself is open in the sense that you are free to install APKs from anywhere you wish, but there are many good reasons for using F-Droid as your libre software app manager:

* Get notified when updates are available
* Optionally download and install updates automatically
* Keep track of older and beta versions
* Filter out apps incompatible with the device
* Find apps via categories and searchable descriptions
* Access associated URLs for donations, source code etc.
* Stay safe by checking repo index signatures and APK hashes
 
F-Droid app description: current website
Current website
	<div class="package-description" dir="auto">
		F-Droid is an installable catalogue of libre software apps for Android. The F-Droid client app makes it easy to browse, install, and keep track of updates on your device.<br /><br />It connects to any F-Droid compatible repositories. The default repo is hosted at f-droid.org, which contains only bona fide libre software.<br /><br />Android itself is open in the sense that you are free to install APKs from anywhere you wish, but there are many good reasons for using F-Droid as your libre software app manager:<br /><br />* Get notified when updates are available<br />* Optionally download and install updates automatically<br />* Keep track of older and beta versions<br />* Filter out apps incompatible with the device<br />* Find apps via categories and searchable descriptions<br />* Access associated URLs for donations, source code etc.<br />* Stay safe by checking repo index signatures and APK hashes<br />
	</div>

(Given effect to and) Converted to <br>

F-Droid app description: this MR
This MR
	<div class="package-description" dir="auto">
		F-Droid is an installable catalogue of libre software apps for Android. The F-Droid client app makes it easy to browse, install, and keep track of updates on your device.<br><br>It connects to any F-Droid compatible repositories. The default repo is hosted at f-droid.org, which contains only bona fide libre software.<br><br>Android itself is open in the sense that you are free to install APKs from anywhere you wish, but there are many good reasons for using F-Droid as your libre software app manager:<br><br>* Get notified when updates are available<br>* Optionally download and install updates automatically<br>* Keep track of older and beta versions<br>* Filter out apps incompatible with the device<br>* Find apps via categories and searchable descriptions<br>* Access associated URLs for donations, source code etc.<br>* Stay safe by checking repo index signatures and APK hashes
	</div>

Converted to <br> (to mark up its effect)

Trailing <br> dropped (since there's no content to start a new line on but voidness)

Essentially HTML:
(no semantic meaning unless marked up with <br>)
eg Obtainium
<p>Obtainium allows you to install and update Apps directly from their releases pages, and receive notifications when new releases are made available.</p>
<p>Read the <a href="https://wiki.obtainium.imranr.dev/">Wiki</a></p>
<p>
	<b>Currently supported App sources:</b>
</p>
<ul>
	<li>
		<p>Open Source - General:</p>
		<ul>
			<li>GitHub</li>
			<li>GitLab</li>
			<li>Forgejo (Codeberg)</li>
			<li>F-Droid</li>
			<li>Third Party F-Droid Repos</li>
			<li>IzzyOnDroid</li>
			<li>SourceHut</li>
		</ul>
	</li>
	<li>
		<p>Other - General:</p>
		<ul>
			<li>APKPure</li>
			<li>Aptoide</li>
			<li>Uptodown</li>
			<li>APKMirror (Track-Only)</li>
			<li>Huawei AppGallery</li>
			<li>Tencent App Store</li>
			<li>CoolApk</li>
			<li>vivo App Store (CN)</li>
			<li>Jenkins Jobs</li>
			<li>RuStore</li>
		</ul>
	</li>
	<li>
		<p>Other - App-Specific:</p>
		<ul>
			<li>Telegram App</li>
			<li>Neutron Code</li>
		</ul>
	</li>
	<li><p>"HTML" (Fallback): Any other URL that returns an HTML page with links to APK files</p></li>
</ul>
<p>
	<b>Limitations:</b>
</p>
<p>
	For some sources, data is gathered using Web scraping and can easily break due to changes in website design. In such cases, more reliable methods may be unavailable.
</p>
Obtainium app description: current website
Current website
	<div class="package-description" dir="auto">
		Obtainium allows you to install and update Apps directly from their releases pages, and receive notifications when new releases are made available.<br />Read the <a href="https://wiki.obtainium.imranr.dev/" rel="external nofollow noopener" target="_blank">Wiki</a><br /><br />	<b>Currently supported App sources:</b><br /><br /><ul><br />	<li><br />		Open Source - General:<br />		<ul><br />			<li>GitHub</li><br />			<li>GitLab</li><br />			<li>Forgejo (Codeberg)</li><br />			<li>F-Droid</li><br />			<li>Third Party F-Droid Repos</li><br />			<li>IzzyOnDroid</li><br />			<li>SourceHut</li><br />		</ul><br />	</li><br />	<li><br />		Other - General:<br />		<ul><br />			<li>APKPure</li><br />			<li>Aptoide</li><br />			<li>Uptodown</li><br />			<li>APKMirror (Track-Only)</li><br />			<li>Huawei AppGallery</li><br />			<li>Tencent App Store</li><br />			<li>CoolApk</li><br />			<li>vivo App Store (CN)</li><br />			<li>Jenkins Jobs</li><br />			<li>RuStore</li><br />		</ul><br />	</li><br />	<li><br />		Other - App-Specific:<br />		<ul><br />			<li>Telegram App</li><br />			<li>Neutron Code</li><br />		</ul><br />	</li><br />	<li>"HTML" (Fallback): Any other URL that returns an HTML page with links to APK files</li><br /></ul><br /><br />	<b>Limitations:</b><br /><br /><br />	For some sources, data is gathered using Web scraping and can easily break due to changes in website design. In such cases, more reliable methods may be unavailable.<br /><br />
	</div>

Converted to extravagant <br>

Obtainium app description: this MR
This MR
	<div class="package-description" dir="auto">
		<p>Obtainium allows you to install and update Apps directly from their releases pages, and receive notifications when new releases are made available.</p>
<p>Read the <a href="https://wiki.obtainium.imranr.dev/" rel="external nofollow noopener" target="_blank">Wiki</a></p>
<p>
	<b>Currently supported App sources:</b>
</p>
<ul>
	<li>
		<p>Open Source - General:</p>
		<ul>
			<li>GitHub</li>
			<li>GitLab</li>
			<li>Forgejo (Codeberg)</li>
			<li>F-Droid</li>
			<li>Third Party F-Droid Repos</li>
			<li>IzzyOnDroid</li>
			<li>SourceHut</li>
		</ul>
	</li>
	<li>
		<p>Other - General:</p>
		<ul>
			<li>APKPure</li>
			<li>Aptoide</li>
			<li>Uptodown</li>
			<li>APKMirror (Track-Only)</li>
			<li>Huawei AppGallery</li>
			<li>Tencent App Store</li>
			<li>CoolApk</li>
			<li>vivo App Store (CN)</li>
			<li>Jenkins Jobs</li>
			<li>RuStore</li>
		</ul>
	</li>
	<li>
		<p>Other - App-Specific:</p>
		<ul>
			<li>Telegram App</li>
			<li>Neutron Code</li>
		</ul>
	</li>
	<li><p>"HTML" (Fallback): Any other URL that returns an HTML page with links to APK files</p></li>
</ul>
<p>
	<b>Limitations:</b>
</p>
<p>
	For some sources, data is gathered using Web scraping and can easily break due to changes in website design. In such cases, more reliable methods may be unavailable.
</p>
	</div>

Correctly treating it as HTML whitespace

A hybrid of both:
eg HTTP Shortcuts
Place shortcuts (widgets) on your home screen to submit HTTP requests to all your favorite RESTful APIs, webservices and other URL resources. Great for home automation projects!
<ul><li>HTTP and HTTPS</li><li>GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS and TRACE</li><li>Basic Authentication, Digest Authentication, Bearer Authentication & Client Certificate Authentication</li><li>Custom request headers</li><li>Custom request body (text only)</li><li>Upload files as form-data or request body</li><li>Support for HTTP proxies</li><li>Support for self-signed certificates</li><li>Built-in icons, support for custom icons or using a site's favicon</li><li>Display response as a toast, window or dialog, or run silently</li><li>Grouping into categories through tabs</li><li>Value injection through variables (e.g., text, numbers, passwords, selections, colors, dates, …)</li><li>Run arbitrary JavaScript before & after execution, including special actions, such as (but not limited to):<ul><li>show dialogs</li><li>show toasts</li><li>prompt for user input (e.g. asking for dates, passwords, text, ...)</li><li>parse JSON or XML responses</li><li>compute HMAC</li><li>store values into global variables for later use</li><li>vibrate</li><li>play notification sounds</li><li>send TCP or UDP packets</li><li>send MQTT messages to a broker</li><li>wake-on-lan</li><li>send Android intents</li><li>trigger Tasker tasks</li><li>read QR code (via 3rd party app)</li><li>read current physical location</li></ul></li><li>Import & Export in JSON or cURL format</li><li>3rd party integration (e.g. Tasker)</li><li>Dark Mode support</li></ul>
Some ideas what to use HTTP shortcuts for:<ul><li>Execute a script on your web server</li><li>Control your home automation system and IoT devices</li><li>Interact with your RaspberryPi and Arduino tinkering projects</li><li>Automate workflows</li><li>Download files</li></ul>
Find it on GitHub: <a href="https://github.com/Waboodoo/HTTP-Shortcuts">https://github.com/Waboodoo/HTTP-Shortcuts</a>.
Or visit the official website for documentation: <a href="https://http-shortcuts.rmy.ch">https://http-shortcuts.rmy.ch</a>
HTTP Shortcuts app description: current website
Current website
	<div class="package-description" dir="auto">
		Place shortcuts (widgets) on your home screen to submit HTTP requests to all your favorite RESTful APIs, webservices and other URL resources. Great for home automation projects!<br /><ul><li>HTTP and HTTPS</li><li>GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS and TRACE</li><li>Basic Authentication, Digest Authentication, Bearer Authentication &amp; Client Certificate Authentication</li><li>Custom request headers</li><li>Custom request body (text only)</li><li>Upload files as form-data or request body</li><li>Support for HTTP proxies</li><li>Support for self-signed certificates</li><li>Built-in icons, support for custom icons or using a site's favicon</li><li>Display response as a toast, window or dialog, or run silently</li><li>Grouping into categories through tabs</li><li>Value injection through variables (e.g., text, numbers, passwords, selections, colors, dates, …)</li><li>Run arbitrary JavaScript before &amp; after execution, including special actions, such as (but not limited to):<ul><li>show dialogs</li><li>show toasts</li><li>prompt for user input (e.g. asking for dates, passwords, text, ...)</li><li>parse JSON or XML responses</li><li>compute HMAC</li><li>store values into global variables for later use</li><li>vibrate</li><li>play notification sounds</li><li>send TCP or UDP packets</li><li>send MQTT messages to a broker</li><li>wake-on-lan</li><li>send Android intents</li><li>trigger Tasker tasks</li><li>read QR code (via 3rd party app)</li><li>read current physical location</li></ul></li><li>Import &amp; Export in JSON or cURL format</li><li>3rd party integration (e.g. Tasker)</li><li>Dark Mode support</li></ul><br />Some ideas what to use HTTP shortcuts for:<ul><li>Execute a script on your web server</li><li>Control your home automation system and IoT devices</li><li>Interact with your RaspberryPi and Arduino tinkering projects</li><li>Automate workflows</li><li>Download files</li></ul><br />Find it on GitHub: <a href="https://github.com/Waboodoo/HTTP-Shortcuts" rel="external nofollow noopener" target="_blank">https://github.com/Waboodoo/HTTP-Shortcuts</a>.<br />Or visit the official website for documentation: <a href="https://http-shortcuts.rmy.ch" rel="external nofollow noopener" target="_blank">https://http-shortcuts.rmy.ch</a><br />
	</div>
HTTP Shortcuts app description: this MR
This MR
	<div class="package-description" dir="auto">
		Place shortcuts (widgets) on your home screen to submit HTTP requests to all your favorite RESTful APIs, webservices and other URL resources. Great for home automation projects!<ul><li>HTTP and HTTPS</li><li>GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS and TRACE</li><li>Basic Authentication, Digest Authentication, Bearer Authentication &amp; Client Certificate Authentication</li><li>Custom request headers</li><li>Custom request body (text only)</li><li>Upload files as form-data or request body</li><li>Support for HTTP proxies</li><li>Support for self-signed certificates</li><li>Built-in icons, support for custom icons or using a site's favicon</li><li>Display response as a toast, window or dialog, or run silently</li><li>Grouping into categories through tabs</li><li>Value injection through variables (e.g., text, numbers, passwords, selections, colors, dates, …)</li><li>Run arbitrary JavaScript before &amp; after execution, including special actions, such as (but not limited to):<ul><li>show dialogs</li><li>show toasts</li><li>prompt for user input (e.g. asking for dates, passwords, text, ...)</li><li>parse JSON or XML responses</li><li>compute HMAC</li><li>store values into global variables for later use</li><li>vibrate</li><li>play notification sounds</li><li>send TCP or UDP packets</li><li>send MQTT messages to a broker</li><li>wake-on-lan</li><li>send Android intents</li><li>trigger Tasker tasks</li><li>read QR code (via 3rd party app)</li><li>read current physical location</li></ul></li><li>Import &amp; Export in JSON or cURL format</li><li>3rd party integration (e.g. Tasker)</li><li>Dark Mode support</li></ul>Some ideas what to use HTTP shortcuts for:<ul><li>Execute a script on your web server</li><li>Control your home automation system and IoT devices</li><li>Interact with your RaspberryPi and Arduino tinkering projects</li><li>Automate workflows</li><li>Download files</li></ul>Find it on GitHub: <a href="https://github.com/Waboodoo/HTTP-Shortcuts" rel="external nofollow noopener" target="_blank">https://github.com/Waboodoo/HTTP-Shortcuts</a>.<br>Or visit the official website for documentation: <a href="https://http-shortcuts.rmy.ch" rel="external nofollow noopener" target="_blank">https://http-shortcuts.rmy.ch</a>
	</div>

<br> inhibited before and after (HTML block elements like) <ul> (since they inherently start on a new line and the effect of a <br> is implied)
(echoes fdroid-website#247 (closed))

Merge request reports

Loading