From c77c23aa45b49f81aec9208a44ab0478f6e1fd35 Mon Sep 17 00:00:00 2001
From: anmeng10101 <33647870+anmeng10101@users.noreply.github.com>
Date: Thu, 5 Nov 2020 10:57:21 +0800
Subject: [PATCH] change the format of xref strings format in description and
summary (#55)
---
src/main/java/com/microsoft/lookup/BaseLookup.java | 2 +-
src/main/java/com/microsoft/util/YamlUtil.java | 2 +-
src/test/java/com/microsoft/lookup/BaseLookupTest.java | 10 +++++-----
.../com.microsoft.samples.SuperHero.ReturnNull.yml | 2 +-
...icrosoft.samples.SuperHero.successfullyAttacked.yml | 4 ++--
...microsoft.samples.subpackage.Person.buildPerson.yml | 2 +-
.../com.microsoft.samples.subpackage.Person.yml | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/microsoft/lookup/BaseLookup.java b/src/main/java/com/microsoft/lookup/BaseLookup.java
index 9619d04..3fd9e99 100644
--- a/src/main/java/com/microsoft/lookup/BaseLookup.java
+++ b/src/main/java/com/microsoft/lookup/BaseLookup.java
@@ -212,7 +212,7 @@ String buildXrefTag(LinkTree linkTree) {
if (StringUtils.isEmpty(label)) {
label = signature;
}
- return String.format("%s", signature, label);
+ return String.format("", signature, label);
}
String buildCodeTag(LiteralTree literalTree) {
diff --git a/src/main/java/com/microsoft/util/YamlUtil.java b/src/main/java/com/microsoft/util/YamlUtil.java
index fe72a3e..abb1c25 100644
--- a/src/main/java/com/microsoft/util/YamlUtil.java
+++ b/src/main/java/com/microsoft/util/YamlUtil.java
@@ -24,7 +24,7 @@ public class YamlUtil {
protected Remark initialValue() {
Options options = Options.github();
options.fencedCodeBlocksWidth = 3;
- options.ignoredHtmlElements.add(IgnoredHtmlElement.create("xref", "uid", "data-throw-if-not-resolved"));
+ options.ignoredHtmlElements.add(IgnoredHtmlElement.create("xref", "uid", "data-throw-if-not-resolved", "data-raw-source"));
return new Remark(options);
}
};
diff --git a/src/test/java/com/microsoft/lookup/BaseLookupTest.java b/src/test/java/com/microsoft/lookup/BaseLookupTest.java
index 3ff7c83..7a7af2c 100644
--- a/src/test/java/com/microsoft/lookup/BaseLookupTest.java
+++ b/src/test/java/com/microsoft/lookup/BaseLookupTest.java
@@ -93,7 +93,7 @@ public void determineComment() {
verify(linkTree).getReference();
verify(linkTree).getLabel();
assertThat("Wrong result", result,
- is("Some text 1Some#signature"));
+ is("Some text 1"));
}
@Test
@@ -121,7 +121,7 @@ public void buildXrefTag() {
String result = baseLookup.buildXrefTag(linkTree);
assertThat("Wrong result", result,
- is("Some#signature"));
+ is(""));
}
@Test
@@ -135,7 +135,7 @@ public void buildXrefTagWhenLabelPresents() {
String result = baseLookup.buildXrefTag(linkTree);
assertThat("Wrong result", result,
- is("" + labelValue + ""));
+ is(""));
}
@Test
@@ -174,8 +174,8 @@ public void replaceLinksAndCodes() {
String result = baseLookup.replaceLinksAndCodes(Arrays.asList(linkTree, literalTree, textTree));
- assertThat("Wrong result", result, is(""
- + "Some#signatureSome text content
" + textTreeContent));
+ assertThat("Wrong result", result, is("Some text content
" + textTreeContent));
}
@Test
diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.ReturnNull.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.ReturnNull.yml
index 4f605cd..972d5a8 100644
--- a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.ReturnNull.yml
+++ b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.ReturnNull.yml
@@ -8,7 +8,7 @@ members:
fullName: "com.microsoft.samples.SuperHero.ReturnNull(Class aClass)"
name: "ReturnNull(Class aClass)"
nameWithType: "SuperHero.ReturnNull(Class aClass)"
- summary: "Returns a FileStoreAttributeView of the given type.\n\nThis method always returns null as no FileStoreAttributeView is currently supported."
+ summary: "Returns a FileStoreAttributeView of the given type.\n\nThis method always returns null as no is currently supported."
parameters:
- description: "a class"
name: "aClass"
diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.successfullyAttacked.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.successfullyAttacked.yml
index b992c03..4f9265a 100644
--- a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.successfullyAttacked.yml
+++ b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.successfullyAttacked.yml
@@ -10,7 +10,7 @@ members:
nameWithType: "SuperHero.successfullyAttacked(int incomingDamage, String damageType)"
summary: "This is a simple description of the method. . . [Superman!][Superman]\n\n\n[Superman]: http://www.supermanisthegreatest.com"
parameters:
- - description: "the amount of incoming damage for SuperHero"
+ - description: "the amount of incoming damage for "
name: "incomingDamage"
type: ""
- description: "type of damage with similar word damageTypeLong, sure"
@@ -18,7 +18,7 @@ members:
type: ""
syntax: "public int successfullyAttacked(int incomingDamage, String damageType)"
exceptions:
- - description: "when incomingDamage is negative and thanks for Exception"
+ - description: "when incomingDamage is negative and thanks for "
type: ""
returns:
description: "the amount of health hero has after attack"
diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.buildPerson.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.buildPerson.yml
index 717daa0..c1db07c 100644
--- a/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.buildPerson.yml
+++ b/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.buildPerson.yml
@@ -8,7 +8,7 @@ members:
fullName: "com.microsoft.samples.subpackage.Person.buildPerson(Person seed)"
name: "buildPerson(Person seed)"
nameWithType: "Person.buildPerson(Person seed)"
- summary: "We need to have this method that takes parameter and return types declared in the current class Test link String A person maybe a SuperHero"
+ summary: "We need to have this method that takes parameter and return types declared in the current class Test link A person maybe a "
parameters:
- name: "seed"
type: ""
diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml
index 31716ef..09fa43c 100644
--- a/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml
+++ b/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml
@@ -3,7 +3,7 @@ uid: "com.microsoft.samples.subpackage.Person"
fullName: "com.microsoft.samples.subpackage.Person"
name: "Person"
nameWithType: "Person"
-summary: "Class that describes some person This comment has links to:\n\n * Owner class Person\n * Its inner class Person.IdentificationInfo\n * Its method Person#setLastName(String lastName)\n * Its method without params Person#setLastName()\n * Its public field Person#age\n * Another class which used here Set\n * Another class which not used here List\n * Broken link sdfdsagdsfghfgh\n * Plain link someContent\n * Link that starts from '\\#' #setLastName()\n * Link with label WordOne\n\nThis is an \"at\" symbol: @"
+summary: "Class that describes some person This comment has links to:\n\n * Owner class \n * Its inner class \n * Its method \n * Its method without params \n * Its public field \n * Another class which used here \n * Another class which not used here \n * Broken link \n * Plain link \n * Link that starts from '\\#' \n * Link with label \n\nThis is an \"at\" symbol: @"
inheritances:
- ""
inheritedMembers: