Anonymous committed 4aebdfe

Using link-label also link-target too.
To make it unique I append an index sequence number (idea by Jens).

Comments (0)

Files changed (1)


 sub main {
     my (@cmd_line) = ($0, @ARGV);
-    my(@index);
+    my(@index, $index_number);
     my($modifiers) = "(not?|m?any|all|much|little)";
     my($word_ends) = "(ed|ing|sion|tion|ould|ate|ize)";
     my($words) = "(are|on|from|with|we)";
 	    # Remove HTML-markup (needs more work to handle HTML ATTRIBUTES).
 	    $_ = $heading;
 	    $_ =~ s/<[^>]+>//g;
-	    # Match a work in Heading somewhat meaningful as a hyper-link.
+	    # Match a word in Heading somewhat meaningful as a link-label.
 	    $data = $1;
-	    # Build unique link-target by using first letter of each word in HEADING.
-	    $name = $_;
-	    $name =~ s/(\w)\w*/$1/g;
-	    $name =~ s/\W+//g;
+	    # Build unique link-target by appending the index-number to the link-label.
+	    $name = $data . $index_number++;
 	    # Incorporate the link-target into the current line, which is a HEADING.
 	    # Create an index-line, containing a hyper-link to this HEADING.
 	    $index = $_;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.