[BUG #7224] more precise regex for sample method links
[BUG #7224] minor fixes and refactoring
[BUG #7224] fix content scroll position after loading samples