Markdown Links in Database Comments for Better Admin UX

📖 2 minutes read

Database comment fields are often filled with plain reference IDs that require manual copying and pasting into search bars or URLs. Here’s a tiny UX improvement that turns those plain IDs into clickable links.

The Problem

Your admin panel lets users add notes to records. Users often reference related resources by ID:

// Admin adds comment like this:
"Related to order #12345"
"See invoice #67890 for details"

Later, someone reads that comment and has to manually navigate to the orders page, search for 12345, etc. Wasted clicks.

The Solution: Markdown Links

Store markdown-formatted links in your comment field instead:

// When saving the comment:
$comment = sprintf(
    '[Order #%d](%s)',
    $order->id,
    route('admin.orders.show', $order)
);

$record->notes = $comment;
$record->save();

Result in the database:

[Order #12345](/admin/orders/12345)

Display It in the UI

Most admin panels render comments as plain text. Parse it with a markdown library on display:

use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter();
$html = $converter->convert($record->notes);

// In your Blade template:
{!! $html !!}

Now your admins see clickable links instead of plain IDs.

When To Use This

  • Audit logs: Link to the user who made the change
  • Error reports: Link to the transaction or session that failed
  • Notes fields: Link to related records
  • Status changes: Link to the approval or rejection action

Quick Wins

  1. Start with one high-traffic admin page
  2. Add markdown rendering to the comments display
  3. Wrap IDs in markdown links when creating new comments
  4. Watch your team stop asking “where do I find order 12345?”

Small change. Big quality of life improvement.

Daryle De Silva

VP of Technology

11+ years building and scaling web applications. Writing about what I learn in the trenches.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *