jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject [10/15] jspwiki git commit: delete JSPWikiMarkupParser#isImageLink(String) and use LinkParsingOperations#isImageLink(String) instead
Date Sun, 03 Dec 2017 18:57:02 GMT
delete JSPWikiMarkupParser#isImageLink(String) and use LinkParsingOperations#isImageLink(String)
instead


Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo
Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/2a87ca5d
Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/2a87ca5d
Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/2a87ca5d

Branch: refs/heads/master
Commit: 2a87ca5d0ca9f7d2d4035447b215ef277ca6b849
Parents: 4ef7ebc
Author: juanpablo <juanpablo@apache.org>
Authored: Sun Dec 3 02:18:22 2017 +0100
Committer: juanpablo <juanpablo@apache.org>
Committed: Sun Dec 3 02:18:22 2017 +0100

----------------------------------------------------------------------
 .../apache/wiki/parser/JSPWikiMarkupParser.java | 29 +++-----------------
 .../wiki/parser/LinkParsingOperations.java      |  3 +-
 2 files changed, 6 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jspwiki/blob/2a87ca5d/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
index 3c594be..0f4ec48 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
@@ -495,27 +495,6 @@ public class JSPWikiMarkupParser extends MarkupParser {
     }
 
     /**
-     *  Matches the given link to the list of image name patterns
-     *  to determine whether it should be treated as an inline image
-     *  or not.
-     */
-    private boolean isImageLink( String link )
-    {
-        if( m_inlineImages )
-        {
-            link = link.toLowerCase();
-
-            for( Iterator< Pattern >  i = m_inlineImagePatterns.iterator(); i.hasNext();
)
-            {
-                if( m_inlineMatcher.matches( link, i.next() ) )
-                    return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
      *  These are all of the HTML 4.01 block-level elements.
      */
     private static final String[] BLOCK_ELEMENTS = {
@@ -1092,7 +1071,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
 
         callMutatorChain( m_externalLinkMutatorChain, url );
 
-        if( isImageLink( url ) )
+        if( m_linkParsingOperations.isImageLink( url ) )
         {
             result = handleImageLink( StringUtils.replace(url,"&amp;","&"), url,
false );
         }
@@ -1311,7 +1290,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
 
                 callMutatorChain( m_externalLinkMutatorChain, linkref );
 
-                if( isImageLink( linkref ) )
+                if( m_linkParsingOperations.isImageLink( linkref ) )
                 {
                     handleImageLink( linkref, linktext, link.hasReference() );
                 }
@@ -1350,7 +1329,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
                         urlReference = TextUtil.replaceString( urlReference, "%s", wikiPage
);
                         urlReference = callMutatorChain( m_externalLinkMutatorChain, urlReference
);
 
-                        if( isImageLink(urlReference) )
+                        if( m_linkParsingOperations.isImageLink(urlReference) )
                         {
                             handleImageLink( urlReference, linktext, link.hasReference()
);
                         }
@@ -1393,7 +1372,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
                 {
                     callMutatorChain( m_attachmentLinkMutatorChain, attachment );
 
-                    if( isImageLink( linkref ) )
+                    if( m_linkParsingOperations.isImageLink( linkref ) )
                     {
                         attachment = m_context.getURL( WikiContext.ATTACH, attachment );
                         sb.append( handleImageLink( attachment, linktext, link.hasReference()
) );

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/2a87ca5d/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java b/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
index bb19311..c05c6d7 100755
--- a/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
@@ -146,7 +146,8 @@ public class LinkParsingOperations {
     }
 
     /**
-     * @see at {@link JSPWikiMarkupParser#isImageLink(String)}.
+     *  Matches the given link to the list of image name patterns to
+     *  determine whether it should be treated as an inline image or not.
      */
     public boolean isImageLink( String link ) {
         if( wikiContext.getEngine().getRenderingManager().getParser( wikiContext, link ).isImageInlining()
)


Mime
View raw message