Skip to content

Commit a7b53db

Browse files
committed
Merge pull request bradyvercher#57 from armab/fix-show_line_numbers
Fix `show_line_numbers`
2 parents 32762f5 + b4808f7 commit a7b53db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/class-gistpress.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public function fetch_gist( $url ) {
457457
public function process_gist_html( $html, array $args ) {
458458
// Remove the line number cell if it has been disabled.
459459
if ( ! $args['show_line_numbers'] ) {
460-
$html = preg_replace( '#<td class="line-numbers">.*?</td>#s', '', $html );
460+
$html = preg_replace( '#<td id="[^"]*" class="blob-num js-line-number" data-line-number="\d+"></td>#s', '', $html );
461461
}
462462

463463
// Remove the meta section if it has been disabled.
@@ -505,9 +505,9 @@ public function process_gist_html( $html, array $args ) {
505505

506506
/**
507507
* Filter the classes applied to a line of the Gist.
508-
*
508+
*
509509
* @since 2.0.0
510-
*
510+
*
511511
* @param array $classes List of HTML class values.
512512
*/
513513
$classes = apply_filters( 'gistpress_line_classes', $classes );

0 commit comments

Comments
 (0)