Skip to content

Commit

Permalink
Merge pull request #125 from rweyrauch/hh2-print
Browse files Browse the repository at this point in the history
Render links.
  • Loading branch information
rweyrauch committed May 5, 2023
2 parents 1513a8f + 55c1d71 commit 52748e0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions css/prettyscribe.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ label {
line-height: 1;
}

.hh2-rule-link {
color: black;
}

.hide_enabled .hide_able:hover {
background-color: rgba(128, 128, 128, .4);
cursor: pointer;
Expand All @@ -361,6 +365,7 @@ label {
.hide_enabled .hidden {
display: none;
}
a, a:visited { color: black; text-decoration: none; }
}

.page_break {
Expand Down
2 changes: 1 addition & 1 deletion dist/prettyscribe.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/rendererHH2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ export class RendererHH2 implements Renderer {
}
if (index != 0) {
let anchor = document.createElement('a');
anchor.classList.add('hh2-rule-link');
anchor.href = "#" + text;
anchor.text = text;
weaponRules.appendChild(anchor);
Expand Down Expand Up @@ -529,6 +530,7 @@ export class RendererHH2 implements Renderer {
}
if (index != 0) {
let anchor = document.createElement('a');
anchor.classList.add('hh2-rule-link');
anchor.href = "#" + text;
anchor.text = text;
weaponRules.appendChild(anchor);
Expand Down Expand Up @@ -607,6 +609,7 @@ export class RendererHH2 implements Renderer {
}
if (index != 0) {
let anchor = document.createElement('a');
anchor.classList.add('hh2-rule-link');
anchor.href = "#" + text;
anchor.text = text;
rulesDiv.appendChild(anchor);
Expand Down
10 changes: 8 additions & 2 deletions src/rosterHH2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ function LookupRole(roleText: string): UnitRole {
return UnitRole.NONE;
}

function InternalKeyword(kw: string): boolean {
return kw.endsWith(':');
}

function CreateUnit(root: Element): Unit | null {
let unit: Unit = new Unit();
const unitName = ExpandBaseNotes(root, unit);
Expand All @@ -704,8 +708,10 @@ function CreateUnit(root: Element): Unit | null {
unit._role = unitRole;
}
else {
// Keyword
unit._keywords.add(catName);
if (!InternalKeyword(catName)) {
// Keyword
unit._keywords.add(catName);
}
}
}
}
Expand Down

0 comments on commit 52748e0

Please sign in to comment.