• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • After MediaWiki Import <div> tags

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: After MediaWiki Import <div> tags

    • Issue Tools
      • View Changes
    1. issueid=2388 June 29, 2011 2:07 PM
      MGP_Tech MGP_Tech is offline
      New Member
      After MediaWiki Import <div> tags
      We have a large number of excess <div> tags

      After a successful import of our MediaWiki data, the only issue on pages I am seeing now is that they all contain excess <div> tags instead of line breaks. I don't want to have to manually edit every page to remove these, is there a better way?
    Issue Details
    Issue Number 2388
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Wiki Pages
    Status Fixed
    Priority 5 - Minor Bugs / Small Tweaks
    Affected Version 3.0.12
    Fixed Version 3.0.13
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. June 29, 2011 2:51 PM
      pegasus pegasus is offline
      VaultWiki Team
      This is intentional and working as designed. Line breaks are left as line breaks. &lt;br&gt; tags are replaced with [div] tags, since most vB installs have HTML disabled. If the [ DIV ] tags are showing in your output, they may be disabled in AdminCP > VaultWiki > Wiki Code Manager. Turn them on to get them to parse.

      EDIT: If you're allowing HTML in your wiki forums, this may cause issues now that I think about it. I've adjusted the code so that it leaves &lt;br&gt; tags alone if HTML is enabled.

      In vault/class/bbcode/legacy/mediawiki.php, find:
      Code:
      	function parse_line_breaks($text)
      	{
      		if ($this->do_html())
      		{
      			$pattern = '#\&lt;br([^\&gt;]*)/?\&gt;#sU';
      		}
      		else
      		{
      			$pattern = '#&amp;lt;br(.*)/?&amp;gt;#sU';
      		}
      
      		if ($this->parser->fake_tags)
      		{
      			return $this->parse_fake($pattern, $text);
      		}
      
      		if (preg_match_all($pattern, $text, $matches))
      		{
      			foreach ($matches[0] AS $key => $search)
      			{
      				$replacement = '[div] ';
      				$attrs = trim($matches[1]["$key"]);
      
      				if ($attrs)
      				{
      					$replacement .= $attrs . ' | ';
      				}
      
      				$replacement .= '[/div]';
      
      				$text = str_replace($search, $this->noedit($replacement), $text);
      			}
      		}
      
      		$text = preg_replace('#(?:\r\n+|\r+|\n+)#s', "\r\n", $text);
      
      		return $text;
      	}
      Replace with:
      Code:
      	function parse_line_breaks($text)
      	{
      		if ($this->do_html())
      		{
      			$pattern = '';
      		}
      		else
      		{
      			$pattern = '#&amp;lt;br(.*)/?&amp;gt;#sU';
      		}
      
      		if ($pattern)
      		{
      			if ($this->parser->fake_tags)
      			{
      				return $this->parse_fake($pattern, $text);
      			}
      
      			if (preg_match_all($pattern, $text, $matches))
      			{
      				foreach ($matches[0] AS $key => $search)
      				{
      					$replacement = '[div] ';
      					$attrs = trim($matches[1]["$key"]);
      
      					if ($attrs)
      					{
      						$replacement .= $attrs . ' | ';
      					}
      
      					$replacement .= '[/div]';
      
      					$text = str_replace($search, $this->noedit($replacement), $text);
      				}
      			}
      		}
      		else if ($this->parser->fake_tags)
      		{
      			return $text;
      		}
      
      		$text = preg_replace('#(?:\r\n+|\r+|\n+)#s', "\r\n", $text);
      
      		return $text;
      	}
      Reply Reply  
    2. June 29, 2011 3:04 PM
      MGP_Tech MGP_Tech is offline
      New Member
      Thank you! Enabling them did the trick, they are no longer showing up on the pages.

      edit: I made the change you suggested as well.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 11:55 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.