Tag Info

New answers tagged

1

It depends on how much of a performance hit you can reasonably accept when throwing the exception. If it only happens once, it might not be a big deal. If it happens every line of the file, it could be a huge problem. Normally exceptions are thrown when something happens that you can't do anything about, and execution is stopped.


0

You could use something like this, Define a rule class where the regex expression to detect the tag is specified, and loop through expressions and insert html where necessary. class Rule { string tagRegEx; string htmlToInsert; } public string Process(string html,List<Rule> rules) { //for each rule, check for regex matches and insert the ...


1

As it looks like these are primarily a list of exclusion filters, something like this might get you where you want to be (example in Java, includes calls to functions that probably don't exist as parts of the test): private static List<Predicate<Node>> AD_FILTERS = Arrays.asList( (node) -> node.getPreviousSibling().isIFrame(), (node) ...



Top 50 recent answers are included