Download the PHP package ekumanov/flarum-ext-markdown-tables without Composer

On this page you can find all versions of the php package ekumanov/flarum-ext-markdown-tables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flarum-ext-markdown-tables

Markdown Tables for Flarum 2.0

Latest Stable Version Total Downloads Backend Tests

Adds proper markdown table support to Flarum 2.0, both in rendered posts and inside the FriendsOfFlarum Rich Text WYSIWYG editor.

This is a Flarum 2.0 port of askvortsov/flarum-markdown-tables — the original Flarum 1.x extension was built on askvortsov-rich-text (ProseMirror-based), which has been replaced in 2.0 by fof-rich-text (Tiptap v3-based). The port was made with Claude Code.

Screenshots

Light Dark

Tables size to their natural content, so a typical post table fits comfortably on mobile. Tables wider than the post column get a horizontal-scroll wrapper instead of forcing every cell to crush.

What you get

Type a standard pipe table in the composer:

…and your post renders it as a proper, styled HTML table — with header row, column alignment from the :---: markers, alternating row backgrounds, and horizontal scrolling when the table is wider than the post column.

Features

Requirements

Installation

Then enable the extension in the admin panel under Extensions > Markdown Tables.

Why rm -rf storage/formatter/*?* Flarum compiles the s9e/text-formatter renderer into a PHP class under `storage/formatter/Renderer_.php.php flarum cache:clear` does not** touch that file. If a renderer was compiled before this extension was active, it has no template branches for <TABLE> / <TR> / <TD> etc., and existing posts that contain table XML will silently render as empty space. Removing the file forces a regenerate that includes the table templates.

Upgrading from Flarum 1.x with askvortsov/flarum-markdown-tables

If you're coming from Flarum 1.x and previously had askvortsov/flarum-markdown-tables installed, your existing post XML is already compatible — both extensions enable the same s9e/text-formatter PipeTables plugin and the stored XML uses the same <TABLE> tag names. No re-parse of old posts is needed.

But you almost certainly do need to clear the formatter cache, because during the period between the 1.x→2.0 migration and the install of this extension the renderer was recompiled without table templates. Run:

After that, every existing post that already had a markdown table will render as a real <table> again — no edits required.

Updating

How it works

Backend

The PHP side is small. We register an Extend\Formatter callback that enables the s9e/text-formatter PipeTables plugin:

PipeTables is already shipped inside s9e/text-formatter (a Flarum core dependency), so this adds zero new code paths to the parser — it just turns on a feature that's already there.

Frontend (forum, always-on)

Two small things happen on the forum side regardless of which editor you use:

  1. Wrap rendered tables for horizontal scroll. PipeTables emits bare <table> elements; without a wrapper, a table wider than the post column overflows or breaks layout. We hook into Post#oncreate/onupdate and wrap each <table> in a <div class="markdown-table-wrapper"> with overflow-x: auto. The wrap is idempotent — a data-markdown-tables-wrapped attribute prevents double-wrapping when Mithril rerenders.

  2. Style the table. Borders use var(--control-bg), header rows pick up var(--control-bg) as background, even rows get a subtle striping. Everything goes through Flarum 2's CSS custom properties so it follows the theme automatically.

Frontend (composer, when fof/rich-text is enabled)

This is where most of the code lives, because Tiptap doesn't know about pipe tables out of the box. The integration happens in four pieces:

1. Tiptap node specs

fof/rich-text exposes Node from @tiptap/core via flarum.reg.get('fof-rich-text', 'common/tiptap/tiptap'). We use that to define six nodes:

Each node has standard parseHTML / renderHTML rules. Cell nodes carry an optional style attribute that holds the alignment (text-align: left|center|right), parsed from the markdown separator and replayed when the cell renders.

The Node constructor is captured lazily, after fof/rich-text's async chunk loads — resolving it at module load time would crash, because the chunk hasn't loaded yet. We push our setup work onto TextEditor.prototype.oninit's _loaders array, which Tiptap's editor awaits before construction.

2. Markdown parser tokens

fof/rich-text's MarkdownParserBuilder uses markdown-it in CommonMark mode, which has the table rule disabled. We patch its prototype to:

3. Markdown serializer

When the user types a table in the WYSIWYG editor and hits submit, Tiptap calls our serializer to turn the doc back into markdown. We hook MarkdownSerializerBuilder.prototype.buildNodes and add a table handler that walks tableHeadtableRowtableHeader, emits the header pipe row, then the alignment separator row (| --- | :---: | ---: |), then each tableBody row.

Pipe characters that appear inside a cell are escaped to \| so they don't break the table syntax.

4. Toolbar dropdown

InsertTableDropdown.js is a Mithril component that extends Flarum's Dropdown. Its menu has two faces:

The button is added to the toolbar via extend(TiptapMenu.prototype, 'items', …), so it sits alongside Bold, Italic, Image, etc.

A note on bundle isolation

Our extension does not bundle @tiptap/extension-table. Instead we built minimal Node specs ourselves and reused fof/rich-text's exposed @tiptap/core Node constructor. This avoids shipping a duplicate copy of Tiptap-core or prosemirror-tables — nodes share the same Tiptap instance the editor is using, so instanceof checks and schema lookups all line up.

The trade-off: we don't get column-resize handles or the cell-selection plugin you'd get from @tiptap/extension-table. For a markdown forum, that's the right trade — pipe tables can't express column widths anyway, so column-resize would only set state that disappears on save.

Limitations

Links

License

MIT — see LICENSE. Original copyright notice retained for the Flarum 1.x extension this is ported from.


All versions of flarum-ext-markdown-tables with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^2.0@beta
php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ekumanov/flarum-ext-markdown-tables contains the following files

Loading the files please wait ...