[completed:603] Fixed systemlink reverse formatter.
This commit is contained in:
parent
2191bdcd22
commit
d157300237
2 changed files with 11 additions and 10 deletions
|
@ -16,5 +16,5 @@ using System.Reflection;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.5.603")]
|
[assembly: AssemblyVersion("3.0.5.604")]
|
||||||
[assembly: AssemblyFileVersion("3.0.5.603")]
|
[assembly: AssemblyFileVersion("3.0.5.604")]
|
|
@ -362,7 +362,7 @@ namespace ScrewTurn.Wiki {
|
||||||
string link = "";
|
string link = "";
|
||||||
string target = "";
|
string target = "";
|
||||||
string title = "";
|
string title = "";
|
||||||
bool isInternalLink = false;
|
bool isSystemLink = false;
|
||||||
bool childImg = false;
|
bool childImg = false;
|
||||||
bool pageLink = false;
|
bool pageLink = false;
|
||||||
if(node.FirstChild != null && node.FirstChild.Name == "img") childImg = true;
|
if(node.FirstChild != null && node.FirstChild.Name == "img") childImg = true;
|
||||||
|
@ -371,11 +371,11 @@ namespace ScrewTurn.Wiki {
|
||||||
XmlAttributeCollection attribute = node.Attributes;
|
XmlAttributeCollection attribute = node.Attributes;
|
||||||
foreach(XmlAttribute attName in attribute) {
|
foreach(XmlAttribute attName in attribute) {
|
||||||
if(attName.Name != "id".ToLowerInvariant()) {
|
if(attName.Name != "id".ToLowerInvariant()) {
|
||||||
if(attName.Value == "_blank") target += "^";
|
if(attName.Value.ToLowerInvariant() == "_blank") target += "^";
|
||||||
if(attName.Name == "href") link += attName.Value.ToString();
|
if(attName.Name.ToLowerInvariant() == "href") link += attName.Value.ToString();
|
||||||
if(attName.Name == "title") title += attName.Value.ToString();
|
if(attName.Name.ToLowerInvariant() == "title") title += attName.Value.ToString();
|
||||||
if(attName.Value == "SystemLink".ToLowerInvariant()) isInternalLink = true;
|
if(attName.Name.ToLowerInvariant() == "class" && attName.Value.ToLowerInvariant() == "systemlink") isSystemLink = true;
|
||||||
if(attName.Value.ToLowerInvariant() == "unknownlink" || attName.Value.ToLowerInvariant() == "pagelink") pageLink = true;
|
if(attName.Name.ToLowerInvariant() == "class" && (attName.Value.ToLowerInvariant() == "unknownlink" || attName.Value.ToLowerInvariant() == "pagelink")) pageLink = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
anchor = true;
|
anchor = true;
|
||||||
|
@ -383,9 +383,10 @@ namespace ScrewTurn.Wiki {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isInternalLink) {
|
if(isSystemLink) {
|
||||||
string[] splittedLink = link.Split('=');
|
string[] splittedLink = link.Split('=');
|
||||||
link = "c:" + splittedLink[1];
|
if(splittedLink.Length == 2) link = "c:" + splittedLink[1];
|
||||||
|
else link = link.LastIndexOf('/') > 0 ? link.Substring(link.LastIndexOf('/') + 1) : link;
|
||||||
}
|
}
|
||||||
else if(pageLink) {
|
else if(pageLink) {
|
||||||
link = link.LastIndexOf('/') > 0 ? link.Substring(link.LastIndexOf('/') + 1) : link;
|
link = link.LastIndexOf('/') > 0 ? link.Substring(link.LastIndexOf('/') + 1) : link;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue