Page text: disable conversion of HTML links to HTML entities











up vote
1
down vote

favorite
1












I have an old Mediawiki site (1.6.x) and I need to upgrade it to 1.31. This site has many pages and many of them have text with html links in the HTML format such as:



<a href="/index.php?title=My_PAGE">Text</a>


I am able to upgrade its database to 1.31. However, in display, the above html links are converted to



&lt;a href="/index.php?title=My_PAGE"&gt;TEXT&lt;/a&gt;


How can I prevent Mediawiki (1.31.x) from performing the above conversion?










share|improve this question




























    up vote
    1
    down vote

    favorite
    1












    I have an old Mediawiki site (1.6.x) and I need to upgrade it to 1.31. This site has many pages and many of them have text with html links in the HTML format such as:



    <a href="/index.php?title=My_PAGE">Text</a>


    I am able to upgrade its database to 1.31. However, in display, the above html links are converted to



    &lt;a href="/index.php?title=My_PAGE"&gt;TEXT&lt;/a&gt;


    How can I prevent Mediawiki (1.31.x) from performing the above conversion?










    share|improve this question


























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I have an old Mediawiki site (1.6.x) and I need to upgrade it to 1.31. This site has many pages and many of them have text with html links in the HTML format such as:



      <a href="/index.php?title=My_PAGE">Text</a>


      I am able to upgrade its database to 1.31. However, in display, the above html links are converted to



      &lt;a href="/index.php?title=My_PAGE"&gt;TEXT&lt;/a&gt;


      How can I prevent Mediawiki (1.31.x) from performing the above conversion?










      share|improve this question















      I have an old Mediawiki site (1.6.x) and I need to upgrade it to 1.31. This site has many pages and many of them have text with html links in the HTML format such as:



      <a href="/index.php?title=My_PAGE">Text</a>


      I am able to upgrade its database to 1.31. However, in display, the above html links are converted to



      &lt;a href="/index.php?title=My_PAGE"&gt;TEXT&lt;/a&gt;


      How can I prevent Mediawiki (1.31.x) from performing the above conversion?







      mediawiki






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 at 18:02









      halfer

      14.2k757106




      14.2k757106










      asked Nov 7 at 17:01









      curious1

      6,0612179140




      6,0612179140
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          I am uncertain presently how to prevent MediaWiki from changing your code, but a possible solution would be to use this



          https://www.mediawiki.org/wiki/Extension:Replace_Text



          after the upgrade to replace &lt; with < and &gt; with >






          share|improve this answer





















          • Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
            – curious1
            Nov 7 at 18:26


















          up vote
          0
          down vote



          accepted










          Unable to find a method, I simply added the following two lines in public function execute() of ExampleTemplate.php



              $html = str_replace('&lt;', '<', $html);
          $html = str_replace('&gt;', '>', $html);


          Please let me know if you know a better way.






          share|improve this answer





















          • This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
            – FO-nTTaX
            Nov 10 at 19:30










          • Thanks for your input!
            – curious1
            Nov 10 at 22:29











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194291%2fpage-text-disable-conversion-of-html-links-to-html-entities%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          I am uncertain presently how to prevent MediaWiki from changing your code, but a possible solution would be to use this



          https://www.mediawiki.org/wiki/Extension:Replace_Text



          after the upgrade to replace &lt; with < and &gt; with >






          share|improve this answer





















          • Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
            – curious1
            Nov 7 at 18:26















          up vote
          1
          down vote













          I am uncertain presently how to prevent MediaWiki from changing your code, but a possible solution would be to use this



          https://www.mediawiki.org/wiki/Extension:Replace_Text



          after the upgrade to replace &lt; with < and &gt; with >






          share|improve this answer





















          • Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
            – curious1
            Nov 7 at 18:26













          up vote
          1
          down vote










          up vote
          1
          down vote









          I am uncertain presently how to prevent MediaWiki from changing your code, but a possible solution would be to use this



          https://www.mediawiki.org/wiki/Extension:Replace_Text



          after the upgrade to replace &lt; with < and &gt; with >






          share|improve this answer












          I am uncertain presently how to prevent MediaWiki from changing your code, but a possible solution would be to use this



          https://www.mediawiki.org/wiki/Extension:Replace_Text



          after the upgrade to replace &lt; with < and &gt; with >







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 18:03









          Hershel

          1497




          1497












          • Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
            – curious1
            Nov 7 at 18:26


















          • Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
            – curious1
            Nov 7 at 18:26
















          Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
          – curious1
          Nov 7 at 18:26




          Thanks for chiming in! Do you mean replace '&lt;' or '&gt;' in database? '<a href="/index.php?title=My_PAGE">Text</a>' is stored in the MySQL database. No '&lt;' or '&gt;' is stored.
          – curious1
          Nov 7 at 18:26












          up vote
          0
          down vote



          accepted










          Unable to find a method, I simply added the following two lines in public function execute() of ExampleTemplate.php



              $html = str_replace('&lt;', '<', $html);
          $html = str_replace('&gt;', '>', $html);


          Please let me know if you know a better way.






          share|improve this answer





















          • This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
            – FO-nTTaX
            Nov 10 at 19:30










          • Thanks for your input!
            – curious1
            Nov 10 at 22:29















          up vote
          0
          down vote



          accepted










          Unable to find a method, I simply added the following two lines in public function execute() of ExampleTemplate.php



              $html = str_replace('&lt;', '<', $html);
          $html = str_replace('&gt;', '>', $html);


          Please let me know if you know a better way.






          share|improve this answer





















          • This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
            – FO-nTTaX
            Nov 10 at 19:30










          • Thanks for your input!
            – curious1
            Nov 10 at 22:29













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          Unable to find a method, I simply added the following two lines in public function execute() of ExampleTemplate.php



              $html = str_replace('&lt;', '<', $html);
          $html = str_replace('&gt;', '>', $html);


          Please let me know if you know a better way.






          share|improve this answer












          Unable to find a method, I simply added the following two lines in public function execute() of ExampleTemplate.php



              $html = str_replace('&lt;', '<', $html);
          $html = str_replace('&gt;', '>', $html);


          Please let me know if you know a better way.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 23:53









          curious1

          6,0612179140




          6,0612179140












          • This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
            – FO-nTTaX
            Nov 10 at 19:30










          • Thanks for your input!
            – curious1
            Nov 10 at 22:29


















          • This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
            – FO-nTTaX
            Nov 10 at 19:30










          • Thanks for your input!
            – curious1
            Nov 10 at 22:29
















          This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
          – FO-nTTaX
          Nov 10 at 19:30




          This is dangerous as this enables full html capabilities for everyone who can edit the wiki.
          – FO-nTTaX
          Nov 10 at 19:30












          Thanks for your input!
          – curious1
          Nov 10 at 22:29




          Thanks for your input!
          – curious1
          Nov 10 at 22:29


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194291%2fpage-text-disable-conversion-of-html-links-to-html-entities%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini