aboutsummaryrefslogtreecommitdiff
path: root/docs/06_Helper_functions/index.md
diff options
context:
space:
mode:
authorGravatar Yaman Qalieh <ybq987@gmail.com> 2022-05-10 03:37:53 -0400
committerGravatar GitHub <noreply@github.com> 2022-05-10 09:37:53 +0200
commit6547ed0c04466ca0d1994c642e002f12ef0b0ace (patch)
tree18be8a7aa67039122df18608ef512e771f0775f9 /docs/06_Helper_functions/index.md
parent8982995445bb04ee164979ab5bcd1bd48f46ca4f (diff)
downloadrss-bridge-6547ed0c04466ca0d1994c642e002f12ef0b0ace.tar.gz
rss-bridge-6547ed0c04466ca0d1994c642e002f12ef0b0ace.tar.zst
rss-bridge-6547ed0c04466ca0d1994c642e002f12ef0b0ace.zip
[docs] Add documentation for html.php functions (#2714)
Diffstat (limited to 'docs/06_Helper_functions/index.md')
-rw-r--r--docs/06_Helper_functions/index.md102
1 files changed, 101 insertions, 1 deletions
diff --git a/docs/06_Helper_functions/index.md b/docs/06_Helper_functions/index.md
index da06d251..708155a8 100644
--- a/docs/06_Helper_functions/index.md
+++ b/docs/06_Helper_functions/index.md
@@ -89,4 +89,104 @@ $html = defaultLinkTo($html, $this->getURI()); // Using bridge URL
// Output
// <img src="https://www.github.com/rss-bridge/rss-bridge/blob/master/README.md">
-``` \ No newline at end of file
+```
+
+# backgroundToImg
+Replaces tags with styles of `backgroud-image` by `<img />` tags.
+
+```php
+backgroundToImg(mixed $htmlContent) : object
+```
+
+Returns a DOM object (even if provided a string).
+
+# extractFromDelimiters
+Extract the first part of a string matching the specified start and end delimiters.
+```php
+function extractFromDelimiters(string $string, string $start, string $end) : mixed
+```
+
+Returns the extracted string if delimiters were found and false otherwise.
+
+**Example**
+
+```php
+$string = '<div>Post author: John Doe</div>';
+$start = 'author: ';
+$end = '<';
+$extracted = extractFromDelimiters($string, $start, $end);
+
+// Output
+// 'John Doe'
+```
+
+# stripWithDelimiters
+Remove one or more part(s) of a string using a start and end delmiters.
+It is the inverse of `extractFromDelimiters`.
+
+```php
+function stripWithDelimiters(string $string, string $start, string $end) : string
+```
+
+Returns the cleaned string, even if no delimiters were found.
+
+**Example**
+
+```php
+$string = 'foo<script>superscript()</script>bar';
+$start = '<script>';
+$end = '</script>';
+$cleaned = stripWithDelimiters($string, $start, $end);
+
+// Output
+// 'foobar'
+```
+
+# stripRecursiveHTMLSection
+Remove HTML sections containing one or more sections using the same HTML tag.
+
+```php
+function stripRecursiveHTMLSection(string $string, string $tag_name, string $tag_start) : string
+```
+
+**Example**
+
+```php
+$string = 'foo<div class="ads"><div>ads</div>ads</div>bar';
+$tag_name = 'div';
+$tag_start = '<div class="ads">';
+$cleaned = stripRecursiveHTMLSection($string, $tag_name, $tag_start);
+
+// Output
+// 'foobar'
+```
+
+# markdownToHtml
+Converts markdown input to HTML using [Parsedown](https://parsedown.org/).
+
+```php
+function markdownToHtml(string $string) : string
+```
+
+**Example**
+```php
+$input = <<<EOD
+RELEASE-2.8
+ * Share QR code of a token
+ * Dark mode improvemnet
+ * Fix some layout issues
+ * Add shortcut to launch the app with screenshot mode on
+ * Translation improvements
+EOD;
+$html = markdownToHtml($input);
+
+// Output:
+// <p>RELEASE-2.8</p>
+// <ul>
+// <li>Share QR code of a token</li>
+// <li>Dark mode improvemnet</li>
+// <li>Fix some layout issues</li>
+// <li>Add shortcut to launch the app with screenshot mode on</li>
+// <li>Translation improvements</li>
+// </ul>
+```
7628e996dc89c81f76114ba37'>treecommitdiff
path: root/src/blob.zig (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-03-16Fix crash from checking if something is an object when it is undefinedbun-v0.0.72Gravatar Jarred Sumner 4-12/+12
2022-03-16Fix setTimeout on LinuxGravatar Jarred SUmner 1-5/+12
2022-03-16Increase from 4ms -> 40ms for timeoutGravatar Jarred SUmner 1-1/+1
2022-03-16Update README.mdGravatar Jarred Sumner 1-0/+1
2022-03-16llvm-stirp not workingGravatar Jarred Sumner 1-1/+0
2022-03-16Update MakefileGravatar Jarred Sumner 1-1/+1
2022-03-16Update Dockerfile.baseGravatar Jarred Sumner 1-0/+1
2022-03-16Update MakefileGravatar Jarred Sumner 1-2/+23
2022-03-16cleanup error printingGravatar Jarred Sumner 7-105/+193
2022-03-16Revert "Unlimited arguments in process.nextTick"Gravatar Jarred Sumner 1-38/+48
2022-03-16bun.lockbGravatar Jarred Sumner 3-0/+0
2022-03-16Update feature_flags.zigGravatar Jarred Sumner 1-0/+1
2022-03-16[bun.js] Bun.unsafe test should check the gcGravatar Jarred Sumner 1-4/+14
2022-03-16Update work_pool.zigGravatar Jarred Sumner 1-21/+28
2022-03-16Add a way to run serial tasks on a different threadGravatar Jarred Sumner 1-3/+65
2022-03-16fix crash when SyntaxError is thrown and we did not receive an ErrorInstance?Gravatar Jarred Sumner 1-18/+25
2022-03-16[bun.js] Fix release-mode test failures in HeadersGravatar Jarred Sumner 1-47/+42
2022-03-16Update ref_count.zigGravatar Jarred Sumner 1-2/+0
2022-03-15file is too bigjarred/replGravatar Jarred Sumner 1-113827/+0
2022-03-15Update Dockerfile.baseGravatar Jarred Sumner 1-1/+1
2022-03-15Add rust and lolhtml to dockerfileGravatar Jarred Sumner 2-0/+20
2022-03-15bump webkitGravatar Jarred Sumner 1-1/+1
2022-03-15Update WebKitGravatar Jarred Sumner 1-0/+0
2022-03-15:camera:Gravatar Jarred Sumner 60-799/+859
2022-03-15Fix test failureGravatar Jarred Sumner 1-15/+17
2022-03-15[bun:error] handle errors without a name or messageGravatar Jarred Sumner 1-6/+11
2022-03-15Update pool.zigGravatar Jarred Sumner 1-0/+1
2022-03-15Load .env by defaultGravatar Jarred Sumner 2-0/+8
2022-03-15mimalloc interpose is buggyGravatar Jarred Sumner 1-2/+25
2022-03-15higher max http requests for bun.jsGravatar Jarred Sumner 1-0/+29
2022-03-15zero copyGravatar Jarred Sumner 1-21/+15
2022-03-15Update javascript.zigGravatar Jarred Sumner 1-2/+0
2022-03-15[bun.js] utf8 console.{time, count, timeEnd, profile, profileEnd, count, cou...Gravatar Jarred Sumner 1-16/+16