Fix missing bullet points and mobile table overflow
Theme's global reset strips list-style from all ul/ol — restored disc/decimal bullets with padding inside .entry-content. Tables now wrapped in a scrollable .prab-table-wrap div via the_content filter (priority 99). Added responsive media query for tighter cell padding on viewports under 600px. Bump 0.7.1 → 0.7.2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
11
CHANGELOG.md
11
CHANGELOG.md
@@ -5,6 +5,17 @@ All notable changes to PRAutoBlogger will be documented in this file.
|
||||
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project uses [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [0.7.2] — 2026-04-20
|
||||
|
||||
### Fixed
|
||||
- **Bullet points missing in articles.** Theme's global CSS reset strips
|
||||
`list-style` from all `ul`/`ol`. Typography CSS now restores disc/decimal
|
||||
bullets with proper padding inside `.entry-content`.
|
||||
- **Tables break on mobile.** Tables now wrapped in a horizontally
|
||||
scrollable container (`prab-table-wrap`) via `the_content` filter.
|
||||
Added responsive media query for tighter padding and smaller font at
|
||||
narrow viewports.
|
||||
|
||||
## [0.7.1] — 2026-04-20
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -92,6 +92,7 @@ class PRAutoBlogger {
|
||||
$typography = new PRAutoBlogger_Article_Typography();
|
||||
add_action( 'wp_head', [ $typography, 'on_wp_head' ] );
|
||||
add_action( 'wp_enqueue_scripts', [ $typography, 'on_enqueue_fonts' ] );
|
||||
add_filter( 'the_content', [ $typography, 'on_wrap_tables' ], 99 );
|
||||
}
|
||||
|
||||
/** Register cron-triggered hooks for scheduled generation and metrics. */
|
||||
|
||||
@@ -81,13 +81,38 @@ class PRAutoBlogger_Article_Typography {
|
||||
);
|
||||
}
|
||||
|
||||
// Restore bullet points — the theme's global reset strips
|
||||
// list-style from all ul/ol, which removes bullets from article
|
||||
// content. This re-applies them inside .entry-content only.
|
||||
$rules[] = implode( "\n", [
|
||||
'.entry-content ul {',
|
||||
"\tlist-style: disc;",
|
||||
"\tpadding-left: 1.5em;",
|
||||
"\tmargin: 1em 0;",
|
||||
'}',
|
||||
'.entry-content ol {',
|
||||
"\tlist-style: decimal;",
|
||||
"\tpadding-left: 1.5em;",
|
||||
"\tmargin: 1em 0;",
|
||||
'}',
|
||||
'.entry-content li {',
|
||||
"\tmargin-bottom: 0.4em;",
|
||||
'}',
|
||||
] );
|
||||
|
||||
$table_borders = get_option( self::OPT_TABLE_BORDERS, '1' );
|
||||
if ( '1' === $table_borders ) {
|
||||
$rules[] = implode( "\n", [
|
||||
// Wrapper for horizontal scroll on narrow viewports.
|
||||
'.entry-content .prab-table-wrap {',
|
||||
"\toverflow-x: auto;",
|
||||
"\t-webkit-overflow-scrolling: touch;",
|
||||
"\tmargin: 1.5em 0;",
|
||||
'}',
|
||||
'.entry-content table {',
|
||||
"\tborder-collapse: collapse;",
|
||||
"\twidth: 100%;",
|
||||
"\tmargin: 1.5em 0;",
|
||||
"\tmin-width: 480px;",
|
||||
'}',
|
||||
'.entry-content th,',
|
||||
'.entry-content td {',
|
||||
@@ -102,6 +127,14 @@ class PRAutoBlogger_Article_Typography {
|
||||
'.entry-content tbody tr:nth-child(even) {',
|
||||
"\tbackground: #f9fafb;",
|
||||
'}',
|
||||
// Mobile: tighter padding, smaller text for tables.
|
||||
'@media (max-width: 600px) {',
|
||||
"\t.entry-content th,",
|
||||
"\t.entry-content td {",
|
||||
"\t\tpadding: 0.4em 0.6em;",
|
||||
"\t\tfont-size: 14px;",
|
||||
"\t}",
|
||||
'}',
|
||||
] );
|
||||
}
|
||||
|
||||
@@ -183,4 +216,39 @@ class PRAutoBlogger_Article_Typography {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap bare <table> elements in a scrollable container for mobile.
|
||||
*
|
||||
* Tables wider than the viewport break mobile layouts. This wraps
|
||||
* each <table> not already inside a wrapper in a
|
||||
* <div class="prab-table-wrap"> that enables horizontal scrolling.
|
||||
*
|
||||
* Only runs on singular post pages.
|
||||
*
|
||||
* Side effects: modifies post HTML content via the_content filter.
|
||||
*
|
||||
* @param string $content Post HTML content.
|
||||
* @return string Modified content with tables wrapped.
|
||||
*/
|
||||
public function on_wrap_tables( string $content ): string {
|
||||
if ( ! is_singular( 'post' ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
if ( '1' !== get_option( self::OPT_TABLE_BORDERS, '1' ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// Wrap <table> elements not already inside a .prab-table-wrap.
|
||||
return (string) preg_replace(
|
||||
'/(?<!prab-table-wrap">)\s*(<table[\s>])/i',
|
||||
'<div class="prab-table-wrap">$1',
|
||||
(string) preg_replace(
|
||||
'/<\/table>\s*/i',
|
||||
'</table></div>',
|
||||
$content
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ declare(strict_types=1);
|
||||
* Plugin Name: PRAutoBlogger
|
||||
* Plugin URI: https://peptiderepo.com/prautoblogger
|
||||
* Description: Monitors social media for trending topics, generates SEO-friendly blog posts using AI, and publishes them on a daily schedule with full cost tracking and self-improvement metrics.
|
||||
* Version: 0.7.1
|
||||
* Version: 0.7.2
|
||||
* Requires at least: 6.0
|
||||
* Requires PHP: 7.4
|
||||
* Author: PeptideRepo
|
||||
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
| and limits without magic strings.
|
||||
*/
|
||||
|
||||
define( 'PRAUTOBLOGGER_VERSION', '0.7.1' );
|
||||
define( 'PRAUTOBLOGGER_VERSION', '0.7.2' );
|
||||
define( 'PRAUTOBLOGGER_DB_VERSION', '1.1.0' );
|
||||
define( 'PRAUTOBLOGGER_PLUGIN_FILE', __FILE__ );
|
||||
define( 'PRAUTOBLOGGER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
|
||||
Reference in New Issue
Block a user