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: The "LMV - Liteweight Markdown Viewer" BBCode (with autodisplay and theming)  (Read 498 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7342
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 02:17:30 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
📎 Click on me to view the list of attachments
ListAttBBC  |  v6.8  |  2026-09-01  |  Andrew.human & Claude.ai
#FileSizeDownloadsInfoDL
00MD_SYNTAX_MANUAL.md7.8 KB4ℹ️⬇️
01Final CHECKPOINT.md9.8 KB9ℹ️⬇️
02gfm_combined_spec.md232.7 KB6ℹ️⬇️
03README-lmv_bbcode.md5.8 KB5ℹ️⬇️
04chatlog-redacted.pdf400.6 KB31ℹ️⬇️
05LMV BBC Updates.pdf252.3 KB12ℹ️⬇️
06Conflicts between MDBBC.php and PDFVVC.php and LMVBBC.php as seen in the PDF and LMV conflcts -- there should be another PDF listing the workcound bbcodes the inpost in question.pdf11.6 MB21ℹ️⬇️
07lmv_bbcode_v3.3.3.zip39.7 KB1ℹ️⬇️
08LMV=inline fixed.pdf386.2 KB4ℹ️⬇️
09lmv_bbcode_v3.3.0.zip37.2 KB0ℹ️⬇️
10lmv_bbcode_v3.3.4.zip37.6 KB1ℹ️⬇️
11conversation-transcript.pdf154.2 KB2ℹ️⬇️
12lmv_bbcode_v4_0.zip38.3 KB0ℹ️⬇️
13lmv_bbcode_v4_1.zip38.7 KB0ℹ️⬇️
14lmv_bbcode_v4_2.zip39.8 KB0ℹ️⬇️
15conversation-transcript-part2.pdf60.5 KB1ℹ️⬇️
The LMV - Liteweight Markdown Viewer

The latest downlodable version is lmv_bbcode_4.2 - introduces the scroll-lg BBCode option.
« Last Edit: Today at 02:27:39 AM by smfadmin »
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

Online smfadmin

  • SMF (internal) Site
  • Administrator
  • Sr. Member
  • *****
  • Join Date: Dec 2014
  • Location: Management
  • Posts: 604
  • Reputation Power: 0
  • smfadmin has hidden their reputation power
  • Last Login:Today at 05:40:36 AM
  • Supplied Install Member
📎 Click on me to view the list of attachments
ListAttBBC  |  v6.8  |  2026-09-01  |  Andrew.human & Claude.ai
#FileSizeDownloadsInfoDL
00LMV and PDF BBCode Conflict Workaround.txt4.6 KB0ℹ️⬇️
01LMV and PDF BBCode Conflict Workaround_.pdf1.4 MB11ℹ️⬇️
02Conflicts between MDBBC.php and PDFVVC.php and LMVBBC.php as seen in the PDF and LMV conflcts -- there should be another PDF listing the workcound bbcodes the inpost in question.pdf11.6 MB20ℹ️⬇️

The LMV - Liteweight Markdown Viewer

Topic bumped

Post Merged: August 14, 2026, 08:54:16 PM
Conflict testing

Display by URL to its webroot filename
[pdf]https://forum.drugs-and-users.org/PIHKAL-PEA.pdf[/pdf]

[b]Display by attachment id[b]
[pdf=attach-0]Display the first valid PDF attachment[/pdf]

Display by attachment id


APut PDF AUTO on aas the last PDF BBC tag



📎 Click on me to view the list of attachments
ListAttBBC  |  v6.8  |  2026-09-01  |  Andrew.human & Claude.ai
#FileSizeDownloadsInfoDL
00LMV and PDF BBCode Conflict Workaround.txt4.6 KB0ℹ️⬇️
01LMV and PDF BBCode Conflict Workaround_.pdf1.4 MB11ℹ️⬇️
02Conflicts between MDBBC.php and PDFVVC.php and LMVBBC.php as seen in the PDF and LMV conflcts -- there should be another PDF listing the workcound bbcodes the inpost in question.pdf11.6 MB20ℹ️⬇️

The LMV - Liteweight Markdown Viewer

Version 3.0+ makes the common code MDBBC.php publically callable

The stable version without auto-CSS installation is lmv_bbcode_v2.2.

The latest version with auto-CSS installation is lmv_bbcode_v2.7.

Both are compatible with SMF 2.0.x and 2.1.x

Examples

Remote URL check:
📝 DEMO2.mdv4.2 · 2026-09-05

PDF BBCode v3.0

Fixed

  • Black/404 viewer on [pdf=attach-NN] and [pdf]url[/pdf]: the inner PDF URL was being urlencode()'d before being passed to PDF.js's file= param. PDF.js 6.2.108 doesn't decode that value, so it tried to fetch a literal path containing %3F/%3D/%3B and got a 404.
  • Same bug, same fix, in the autodisplay path (pdf_display_patch.xml and pdf_display_patch_21.xml) — urlencode($attachment['href']) removed.
  • Removed schemeless() stripping on the inner PDF URL. PDF.js 6.2.108 needs an explicit http:/https: scheme to pick a fetch adapter — without it, "No available adapters." schemeless() is still used for the outer viewer.html iframe src, which was never broken.
  • 2.0.x install block was missing <require-dir name="pdfjs" destination="$themedir" /> entirely — added, matching the 2.1.x block.

Install location

pdfjs/ installs to $themedir (e.g. Themes/default/pdfjs), not $boarddir.

Notes

  • Live production was found running an unpatched, several-versions-behind PDFBBC.php despite package history showing v2.22 as reinstalled — several rounds of "the fix didn't work" were actually "the fix was never deployed." Worth checking the live file's VERSION const at the start of future debugging sessions.
  • Treat this as a full Package Manager uninstall + reinstall, not a hot-swap — the 2.0.x block now installs a directory it didn't before.
-- remote URL
 
Attachment by DB ID 400.:
⚠️ Attachment #1 not found or pending save.
  -- attachment by DB ID

[lmv=0][/lmv] -- auto-detect (last .md attachment)

Attachment by id number 0:
 unscrollablle 1st  nth .md attachment on the post starting from 0

Attachment by id number 1:
⚠️ No .md attachment at index 1 for message #49431 (currentMsgId() returned this value).
nth .md attachment on the post starting from 0

Turn on autodisplay and override the ID and id numbers:

[lmv=autodisplay] ON [/lmv] --  toggle  automatic attachment display on

 -- toggle automatic attachment display off

Display by attachment id


📝 Inline Markdownv4.2 · 2026-09-05

Session Checkpoint — 2026-08-07/08


1. PDFIndexer.py cron fix — DONE, confirmed working

  • Root cause: LOG_PATH/WORD_INDEX_PATH/PDF_STORE_PATH were relative

  paths (ISE_Data/...), which broke under cron's CWD (apache's home   dir, not the script's directory) — PermissionError on   os.makedirs().

  • Fix: anchored all three paths to ISE_ROOT, mirroring

  IndexBuilder.py's existing (working) convention exactly —   Path(__file__).resolve().parent.parent, overridable via an   ISE_ROOT env var (confirmed not set anywhere on this box).

  • Tightened dev/live detection from a loose 192.168. prefix match to the exact dev IP (192.168.233.129).

  • Root cause: LOG_PATH/WORD_INDEX_PATH/PDF_STORE_PATH were relative

  paths (ISE_Data/...), which broke under cron's CWD (apache's home   dir, not the script's directory) — PermissionError on   os.makedirs().

  • Fix: anchored all three paths to ISE_ROOT, mirroring

  IndexBuilder.py's existing (working) convention exactly —   Path(__file__).resolve().parent.parent, overridable via an   ISE_ROOT env var (confirmed not set anywhere on this box).

  • Tightened dev/live detection from a loose 192.168. prefix match to the exact dev IP (192.168.233.129).

  • Root cause: LOG_PATH/WORD_INDEX_PATH/PDF_STORE_PATH were relative

  paths (ISE_Data/...), which broke under cron's CWD (apache's home   dir, not the script's directory) — PermissionError on   os.makedirs().

  • Fix: anchored all three paths to ISE_ROOT, mirroring

  IndexBuilder.py's existing (working) convention exactly —   Path(__file__).resolve().parent.parent, overridable via an   ISE_ROOT env var (confirmed not set anywhere on this box).

  • Tightened dev/live detection from a loose 192.168. prefix match to the exact dev IP (192.168.233.129).

  • Root cause: LOG_PATH/WORD_INDEX_PATH/PDF_STORE_PATH were relative

  paths (ISE_Data/...), which broke under cron's CWD (apache's home   dir, not the script's directory) — PermissionError on   os.makedirs().

  • Fix: anchored all three paths to ISE_ROOT, mirroring

  IndexBuilder.py's existing (working) convention exactly —   Path(__file__).resolve().parent.parent, overridable via an   ISE_ROOT env var (confirmed not set anywhere on this box).

  • Tightened dev/live detection from a loose 192.168. prefix match to the exact dev IP (192.168.233.129).

  • Root cause: LOG_PATH/WORD_INDEX_PATH/PDF_STORE_PATH were relative

  paths (ISE_Data/...), which broke under cron's CWD (apache's home   dir, not the script's directory) — PermissionError on   os.makedirs().

  • Fix: anchored all three paths to ISE_ROOT, mirroring

  IndexBuilder.py's existing (working) convention exactly —   Path(__file__).resolve().parent.parent, overridable via an   ISE_ROOT env var (confirmed not set anywhere on this box).

  • Tightened dev/live detection from a loose 192.168. prefix match to the exact dev IP


« Last Edit: August 14, 2026, 09:05:02 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
measure twice, cut once

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