Skip to:
Content

Opened 5 years ago

Closed 5 years ago

Last modified 4 months ago

#2558 closed defect (fixed)

Conversion issues SMF to bbPress

Reported by: mspecht Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.3
Component: API - Importers Keywords: has-patch
Cc:

Description

There are two minor issues with the SMF.php importer. &nbsp; and <br> are not being converted correctly.

Lines 722 - 728 instead of :

		// Replace '<br />' with ''
		$SMF_markup = preg_replace( '/\<br \/\>/',   '<tt>',  $SMF_markup );

		// Replace '[size=$1]' with '<span style="font-size:$1%;">$3</span>'
		$SMF_markup = preg_replace( '/\[size=(.*?)\]/', '<span style="font-size:$1">', $SMF_markup );
		// Replace '[/size]' with '</span>'
		$SMF_markup = preg_replace( '/\[\/size\]/',     '</span>',  $SMF_markup );


Needs to be something like:

		// Replace '<br />' with ''
		$SMF_markup = preg_replace( '/\<br \/\>/',   '<br>',  $SMF_markup );

		// Replace '[size=$1]' with '<span style="font-size:$1%;">$3</span>'
		$SMF_markup = preg_replace( '/\[size=(.*?)\]/', '<span style="font-size:$1">', $SMF_markup );
		// Replace '[/size]' with '</span>'
		$SMF_markup = preg_replace( '/\[\/size\]/',     '</span>', $SMF_markup );

		// Replace '&nbsp;' with ' '
		$SMF_markup = preg_replace ( '/&nbsp;/', ' ', $SMF_markup );

Attachments (1)

2558.diff (2.6 KB) - added by netweb 5 years ago.

Download all attachments as: .zip

Change History (5)

@netweb
5 years ago

#1 @netweb
5 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 2.6

Thanks for this, let me know if you find any others and we'll ship this as part of 2.6

#2 @netweb
5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In r5332:

SMF Importer BBCode regex expressions

  • Fix copy pasta <br>/<tt> regex
  • Add non-break space &nbsp; to space rexex
  • Props mspecht. Fixes #2558

#3 @johnjamesjacoby
2 years ago

In 6476:

Converters: Port r5332 to 2.5 branch.

See #2558, #3112.

#4 @johnjamesjacoby
4 months ago

Assigning all closed & unassigned tickets in the 2.6 milestone to myself.

Note: See TracTickets for help on using tickets.