Ignore:
Timestamp:
2020-02-13T16:11:24+01:00 (4 years ago)
Author:
stoecker
Message:

allow three dots at the end of a ignore line to skip ever changing URLs, use like 'http...' at the end of entry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.java

    r15712 r15850  
    110110    private static boolean optionNoEli;
    111111    private Map<String, String> skip = new HashMap<>();
     112    private Map<String, String> skipStart = new HashMap<>();
    112113
    113114    /**
     
    249250                Matcher res = pattern.matcher(line);
    250251                if (res.matches()) {
    251                     if ("Ignore".equals(res.group(1))) {
    252                         skip.put(res.group(2), "green");
    253                     } else {
    254                         skip.put(res.group(2), "darkgoldenrod");
     252                    String s = res.group(2);
     253                    if(s.endsWith("..."))
     254                    {
     255                        s = s.substring(0, s.length() - 3);
     256                        if ("Ignore".equals(res.group(1))) {
     257                            skipStart.put(s, "green");
     258                        } else {
     259                            skipStart.put(s, "darkgoldenrod");
     260                        }
     261                    }
     262                    else
     263                    {
     264                        if ("Ignore".equals(res.group(1))) {
     265                            skip.put(s, "green");
     266                        } else {
     267                            skip.put(s, "darkgoldenrod");
     268                        }
    255269                    }
    256270                }
     
    271285    }
    272286
     287    String isSkipString(String s) {
     288        if (skip.containsKey(s))
     289            return skip.get(s);
     290        for (Entry<String, String> str : skipStart.entrySet()) {
     291            if (s.startsWith(str.getKey()))
     292                return str.getValue();
     293        }
     294        return null;
     295    }
     296   
    273297    void myprintln(String s) {
    274         if (skip.containsKey(s)) {
    275             String color = skip.get(s);
     298        String color;
     299        if ((color = isSkipString(s)) != null) {
    276300            skip.remove(s);
    277301            if (optionXhtmlBody || optionXhtml) {
     
    283307            }
    284308        } else if (optionXhtmlBody || optionXhtml) {
    285             String color =
     309            color =
    286310                    s.startsWith("***") ? "black" :
    287311                        ((s.startsWith("+ ") || s.startsWith("+++ ELI")) ? "blue" :
Note: See TracChangeset for help on using the changeset viewer.