dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Markdown BBCode [md]  (Read 16 times)

Online Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7267
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 09:07:34 PM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Markdown BBCode [md]
« on: Today at 10:22:57 AM »
The BBCode renders Markdown tags like GitHub renders README.md

Also install: https://forum.drugs-and-users.org/index.php?topic=7581

Install by downloading md_bbcode_v10.1

Use:

[md] .... [/md]

See the readme:

Code: [Select]
Markdown BBCode tag - v10.1
One package, SMF 2.0.x through 2.1.x

WHAT THIS VERSION IS
A single package that installs correctly on both older/customized SMF
2.0.x forks and on stock SMF 2.1. Package Manager reads your forum's
actual version and automatically uses the matching install method
below - nothing to choose by hand.

The tag itself is now implemented as a single class, MDBBCode, with
the hook registered as MDBBCode::integrate - matching this codebase's
existing convention of class-method hook callbacks (the same pattern
already used by several other mods registered under
integrate_bbc_codes on this forum), rather than a loose standalone
function.

On 2.0.x, some customized forks do not support file-based hook
auto-loading the way stock SMF normally does. This package handles
that automatically: it registers the hook function by name, and
separately ensures the file containing that function is loaded before
the hook fires, using whichever mechanism your version of SMF
actually supports. All of this happens through Package Manager, with
no manual command line steps required on either branch.

On stock SMF 2.1, registration uses the standard declarative hook
method built into Package Manager itself, since 2.1 supports file
auto-loading normally.

In every case, Subs.php is never edited, by a human or by any
installer code, at any point.

WHAT THIS DOES
Adds a new forum tag, written as the letters m and d enclosed in
square brackets to open, and a forward slash then m and d enclosed
in square brackets to close, with no spaces inside the brackets in
actual use. Anything typed between the opening and closing tag is
treated as Markdown source text and converted to real HTML when the
post is displayed: headings, bold and italic text, links, images,
lists, block quotes, code blocks, and GitHub-style tables.

VERIFYING IT TOOK EFFECT
After installing through Package Manager, on either branch, this
confirms the tag is registered without needing to make a test post:

php -r '
require_once "SSI.php";
$codes = array();
call_integration_hook("integrate_bbc_codes", array(&$codes));
$found = false;
foreach ($codes as $c) { if ($c["tag"] === "md") { $found = true; break; } }
echo $found ? "md tag IS registered\n" : "md tag NOT found in codes array\n";
'

If either install path is ever silently cleared by some other package
manager activity (has happened once, on a customized 2.0.x fork),
simply reinstalling this package restores it, with no manual command
required.

SUPPORTED SYNTAX, DESCRIBED IN WORDS
Headings: a line starting with between one and six hash characters
followed by a space and the heading text.
Emphasis: text surrounded by a pair of asterisk characters becomes
bold; text surrounded by a single asterisk on each side becomes
italic; text surrounded by three asterisks on each side becomes both.
Strikethrough: text surrounded by a pair of tilde characters on each
side.
Inline code: text surrounded by a single backtick character on each
side.
Code blocks: either a block surrounded above and below by a line of
three backtick or three tilde characters, optionally followed by a
programming language name on the opening line; or a block where every
line is indented by four spaces or one tab character.
Block quotes: a line starting with a greater than character; can be
nested by using two greater than characters for an inner quote.
Lists: a line starting with a hyphen, asterisk, or plus character
followed by a space starts an unordered list item; a line starting
with a number, a period, and a space starts an ordered list item;
deeper indentation nests a list inside the item above it.
Links: square bracketed link text, immediately followed by the
destination web address in round brackets, optionally followed by a
quoted title inside those same round brackets.
Images: the same pattern as a link, with an exclamation mark placed
immediately before the opening square bracket.
Bare web addresses can also be auto linked by surrounding the address
with angle brackets.
Horizontal rules: a line made up of three or more hyphen, asterisk,
or underscore characters and nothing else.
Line breaks: ending a line with two trailing space characters forces
a line break at that point rather than joining it into the next line.
Escaping: placing a backslash character immediately before a
punctuation character makes that character display literally instead
of being treated as markdown syntax.
Tables: a row of cell text separated by vertical bar characters,
immediately followed by a row of dashes separated by vertical bars,
starts a table; further rows of cell text become the table's data
rows. A colon at the start of a column's dashes left-aligns that
column, a colon at the end right-aligns it, and colons at both ends
center it.

This is a compact subset of Markdown built for forum posts. It does
not implement footnotes or reference style links. Content using those
extensions will display as plain escaped text rather than being
rejected or causing an error.

SECURITY
Raw HTML typed inside the tag, such as script elements or image
elements with event handler attributes, is always escaped to plain
text and never rendered as markup. Web addresses used in links or
images are restricted to the http, https, ftp, ftps and mailto
schemes; anything else, such as a javascript or data scheme address,
is left as plain, non clickable text instead of becoming a link.

RELIABILITY
If MDParser.php is ever missing, if the MDParser class fails to load
for any reason, or if parsing throws an error on unusual input, the
tag falls back to showing the original text unparsed rather than
causing a fatal error. Worst case is one plain looking post, never a
broken page.

OPTIONAL STYLING
The rendered output is wrapped in a division element with the class
name md-block, code blocks use md-code-block, and tables use
md-table. Add appearance for each through Admin Control Panel, Themes
and Layout, Edit Style Sheet, in either the custom stylesheet or the
main index stylesheet. A starting stylesheet has already been
provided separately and works unchanged on either branch.

UNINSTALLING
Use Package Manager as normal, on either branch. It automatically
removes the hook registration in addition to the two files, so no
manual command line steps are needed to fully undo the install.

FILES INSTALLED
Sources/MDParser.php: the markdown to HTML converter.
Sources/MDBBC.php: defines the tag itself, through the MDBBCode class
and its integrate, add, and validate static methods.
On 2.0.x only: two small install/uninstall helper files, run once
each by Package Manager itself and not left behind as active mod
files.

Example:

💤 SleepStack1 – GABAergic Night Stack

A synergistic supplement stack designed to promote GABAergic tone, enhance serotonin/melatonin synthesis, and support deep, restorative sleep.

đź§Ş Ingredients & Dosages

  • 🌙 GABA – 2250 mg 

  → Primary inhibitory neurotransmitter; promotes calm 

  • 🌿 L-Theanine – 400 mg 

  → Enhances alpha waves, reduces anxiety, synergizes with GABA 

  • 🔬 Alpha-Lipoic Acid (ALA) – 300 mg 

  → Supports BBB permeability & mitochondrial repair 

  • đź’Š 5-HTP – 200 mg 

  → Serotonin precursor → melatonin; taken on empty stomach 

  • đź§  Vitamin B6 (P5P form preferred) – 1.7 mg to 25 mg 

  → Cofactor for GABA & serotonin synthesis 

  • 🌶️ Piperine (Black Pepper Extract) – 20 mg 

  → Enhances bioavailability of 5-HTP, ALA, and GABA


đź•’ Dosing Schedule

Time Before BedSupplements                                     
30–60 min       💊 5-HTP (empty stomach)                       
20–30 min       🌙 GABA + 🌿 Theanine + 🔬 ALA + 🌶️ Piperine   

đź’¤ Expected Benefits

  • Faster sleep onset 
  • Deeper, uninterrupted sleep 
  • Reduced mental chatter 
  • Elevated mood next day 
  • Enhanced GABAergic activity

đźš« What to Avoid at Night

  • Caffeine or stimulants 
  • Bright screens (blue light) 
  • L-Histidine (histamine precursor)

« Last Edit: Today at 12:49:29 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal