| orion.core.linkScanner | ||
|---|---|---|
|
|
|
| orion.page.link.related | orion.core.content | |
Link scanners are declarative services that specify patterns of text to replace with link anchors. Scanners contribute a regular expression pattern to match in the source text. They then provide a link to be inserted for each match. These scanners are used by the text link service to convert text into a DOM node with appropriate anchor and text nodes as children.
None.
Implementations of orion.core.linkScanner must define the following attributes:
The following scanner will replace text of the form "bug 123456" with links of the form " https://bugs.eclipse.org/123456
var provider = new eclipse.PluginProvider();
var serviceImpl = {};
var serviceProperties = {
pattern: "bug\\s\\d{4,7}",
words: 2,
anchor: "https://bugs.eclipse.org/%2"
};
provider.registerServiceProvider("orion.core.linkScanner", serviceImpl, serviceProperties);
provider.connect();
This scanner will replace email addresses with mailto: URLs:
var provider = new eclipse.PluginProvider();
var serviceImpl = {};
var serviceProperties = {
pattern: "\\bA-Z0-9._%-+@A-Z0-9.-+\\.A-Z{2,4}\\b",
words: 1,
anchor: "mailto:%1"
};
provider.registerServiceProvider("orion.core.linkScanner", serviceImpl, serviceProperties);
provider.connect();
|
|
|
| orion.page.link.related | orion.core.content |