Skip to content

Commit 4b870b7

Browse files
committed
fix table title rule
1 parent dff2255 commit 4b870b7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/guides/modules/permissions-authentication/pages/openid-connect-tokens.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ gcloud iam workload-identity-pools create-cred-config \
322322
Download::
323323
+
324324
--
325-
If you choose to download the configuration file once and commit this to your repository, save the downloaded configuration file in your repository. There are no naming restrictions but best practice is to give it a descriptive name, for example, `gcp-config-dev.json`. You will reference this file in your CircleCI configuration.
325+
Download the configuration file once and commit this to your repository. You can name the file anything you like but best practice is to give it a descriptive name, for example, `gcp-config-dev.json`. You will reference this file in your CircleCI configuration.
326326
--
327327
====
328328

styles/circleci-docs/TableTitles.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ script: |
99
matches := []
1010
1111
lines := text.split(scope, "\n")
12-
table_delimiter_count := 0
12+
in_table := false
1313
1414
for i, line in lines {
1515
trimmed := text.trim_space(line)
1616
1717
// Check for table delimiter
1818
if trimmed == "|===" {
19-
// Even count = opening delimiter, odd count = closing delimiter
20-
is_opening := table_delimiter_count % 2 == 0
21-
22-
if is_opening {
23-
// Look back for a title, skipping empty lines, attributes, and block delimiters
19+
// Toggle table state
20+
if !in_table {
21+
// This is an opening delimiter
2422
has_title := false
2523
24+
// Look back for a title, skipping empty lines, attributes, and block delimiters
2625
for j := i - 1; j >= 0; j-- {
2726
prev_trimmed := text.trim_space(lines[j])
2827
@@ -61,8 +60,11 @@ script: |
6160
start := text.index(scope, line)
6261
matches = append(matches, {begin: start, end: start + len(line)})
6362
}
64-
}
6563
66-
table_delimiter_count = table_delimiter_count + 1
64+
in_table = true
65+
} else {
66+
// This is a closing delimiter, just toggle state
67+
in_table = false
68+
}
6769
}
6870
}

0 commit comments

Comments
 (0)