Skip to content

Commit b27890d

Browse files
anchor link inline issue
1 parent 18b319c commit b27890d

File tree

7 files changed

+6760
-0
lines changed

7 files changed

+6760
-0
lines changed

src/test/java/com/contentstack/utils/RTEResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public class RTEResult {
1818
public static String kCodeHtml = "<code>Code template.</code>";
1919
public static String kLinkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href=\"LINK.com\">LINK</a></p>";
2020
public static String kEmbedHtml = "<iframe src=\"https://www.youtube.com/watch?v=AOP0yARiW8U\"></iframe>";
21+
public static String kWFSAffectedHtml = "<p redactor-attributes=\"{}\" style=\"\" dir=\"ltr\"><strong>In this article:<br />\t</strong><a target=\"_self\" href=\"#Overview\">Overview</a><br />\t<a target=\"_self\" href=\"#Fulfillment\">Standard Fulfillment</a><br />\t<a target=\"_self\" href=\"#AdditionalFees\">Additional Fees</a><br />\t<a target=\"_self\" href=\"#BigBulkyFulfillment\">Big & Bulky Fulfillment</a><br />\t<a target=\"_self\" href=\"#Storage\">Storage</a><br />\t<a target=\"_self\" href=\"#ProblemInventory\">Problem Inventory</a><br />\t<a target=\"_self\" href=\"#Return\">Return Shipping & Exceptions</a><br />\t<a target=\"_self\" href=\"#DisposalRemoval\">Disposal & Removal</a><br />\t<a target=\"_self\" href=\"#AdditionalPrograms\">Additional WFS Programs</a></p><h2 redactor-attributes=\"{}\" style=\"\" id=\"Overview\" dir=\"ltr\">Overview</h2><p redactor-attributes=\"{}\" style=\"\" dir=\"ltr\">Walmart Fulfillment Services is a competitive and cost-effective solution that offers an end-to-end ecommerce fulfillment experience. Our fee structure is simple and straightforward, without signup or monthly subscription fees. You're also free to ship and store any amount of inventory you choose, without minimums or maximums. Use the <a href=\"https://marketplace.walmart.com/walmart-fulfillment-services-pricing/?_gl=1*1t4i6i1*_ga*OTkwMDc3NzQuMTY1MjM3NjY3Nw..*_ga_1LB22TM2MG*MTY1MjcyNDU5My41OS4xLjE2NTI3MjY5NzIuMA..\">WFS Calculator</a> to estimate your fulfillment and storage fees.<br /><br />The following fees are effective as of August 2023 and are subject to change.</p>";
2122
public static String kAnchorHtml = "<p redactor-attributes=\"{}\" style=\"\" dir=\"ltr\">This is a paragraph with break true and<br />backslash nThis para has just one line break without any break key<br />Third paragraph with multiple line breaks<br /><br /><br />Fourth paragraph with multiple line breaks and break key<br /><br />Fifth paragraph with multiple only tab \t and this is text after tab<br />\tThis paragraph should start with a tab and should have a break before.</p>";
2223
public static String kWFSFeesHtml = "<p redactor-attributes=\"{}\" style=\"\" dir=\"ltr\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <br /><br /><br />\t\t\t\tUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <br />Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <br />\tExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>";
2324

25+
public static String kONEHtml = "<p redactor-attributes=\"{}\" style=\"\" dir=\"ltr\"><br />A paragraph with break set as trueA paragraph with line break <br /> and \t tab</p>";
2426
}

src/test/java/com/contentstack/utils/TestRte.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public void testHERFID() throws IOException {
106106
}
107107

108108

109+
109110
@Test
110111
public void testAnchorIssue() throws IOException {
111112
final String rte = "src/test/resources/reports/anchor.json";
@@ -114,5 +115,42 @@ public void testAnchorIssue() throws IOException {
114115
Assert.assertEquals(kAnchorHtml, result);
115116
}
116117

118+
@Test
119+
public void testAffectedEntry() throws IOException {
120+
final String rte = "src/test/resources/reports/wfs.json";
121+
JSONObject theRTE = new ReadResource().readJson(rte);
122+
String result = Utils.jsonToHTML(theRTE, new DefaultOption(), null);
123+
System.out.println(result);
124+
Assert.assertEquals(kWFSAffectedHtml, result);
125+
}
126+
127+
128+
@Test
129+
public void testOne() throws IOException {
130+
final String rte = "src/test/resources/reports/one.json";
131+
JSONObject theRTE = new ReadResource().readJson(rte);
132+
String result = Utils.jsonToHTML(theRTE, new DefaultOption(), null);
133+
System.out.println(result);
134+
Assert.assertEquals(kONEHtml, result);
135+
}
136+
137+
@Test
138+
public void testOCT7Issue() throws IOException {
139+
final String rte = "src/test/resources/reports/oct_7.json";
140+
JSONObject theRTE = new ReadResource().readJson(rte);
141+
String result = Utils.jsonToHTML(theRTE, new DefaultOption(), null);
142+
System.out.println(result);
143+
// Assert.assertEquals(kONEHtml, result);
144+
}
145+
146+
@Test
147+
public void testIssueOct() throws IOException {
148+
final String rte = "src/test/resources/reports/issue_oct.json";
149+
JSONObject theRTE = new ReadResource().readJson(rte);
150+
String result = Utils.jsonToHTML(theRTE, new DefaultOption(), null);
151+
System.out.println(result);
152+
// Assert.assertEquals(kONEHtml, result);
153+
}
154+
117155

118156
}

0 commit comments

Comments
 (0)