Skip to content

Commit 548b968

Browse files
authored
Merge branch 'main' into repo-assist/fix-issue-924-watch-root-override-c4e35a7b2fb520aa
2 parents f412f0c + 7adcc97 commit 548b968

10 files changed

Lines changed: 506 additions & 661 deletions

File tree

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"rollForward": false
1111
},
1212
"fsharp-analyzers": {
13-
"version": "0.35.0",
13+
"version": "0.36.0",
1414
"commands": [
1515
"fsharp-analyzers"
1616
],
1717
"rollForward": false
1818
},
1919
"dotnet-repl": {
20-
"version": "0.1.216",
20+
"version": "0.3.250",
2121
"commands": [
2222
"dotnet-repl"
2323
],

.github/aw/actions-lock.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"entries": {
3+
"actions/checkout@v6.0.2": {
4+
"repo": "actions/checkout",
5+
"version": "v6.0.2",
6+
"sha": "de0fac2e4500dabe0009e67214ff5f5447ce83dd"
7+
},
8+
"actions/github-script@v8": {
9+
"repo": "actions/github-script",
10+
"version": "v8",
11+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
12+
},
13+
"github/gh-aw-actions/setup@v0.61.1": {
14+
"repo": "github/gh-aw-actions/setup",
15+
"version": "v0.61.1",
16+
"sha": "be0029bbbaeef8c6bea6825f31d9593219b2dc28"
17+
},
18+
"github/gh-aw-actions/setup@v0.62.5": {
19+
"repo": "github/gh-aw-actions/setup",
20+
"version": "v0.62.5",
21+
"sha": "dc50be57c94373431b49d3d0927f318ac2bb5c4c"
22+
},
23+
"github/gh-aw/actions/setup@v0.62.5": {
24+
"repo": "github/gh-aw/actions/setup",
25+
"version": "v0.62.5",
26+
"sha": "48d8fdfddc8cad854ac0c70ceb573f09fb8f9c9b"
27+
}
28+
}
29+
}

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
ignore:
8+
# ignore updates to gh-aw-actions, which only appears in auto-generated *.lock.yml
9+
# files managed by 'gh aw compile' and should not be touched by dependabot
10+
- dependency-name: "github/gh-aw-actions"
711

812
- package-ecosystem: nuget
913
directory: "/"

.github/workflows/pull-requests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Build and Test PR
22

33
on:
4-
push:
5-
branches:
6-
- main
74
pull_request:
85
branches:
96
- main

.github/workflows/repo-assist.lock.yml

Lines changed: 274 additions & 638 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/repo-assist.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: |
3-
A friendly repository assistant that runs 4 times a day to support contributors and maintainers.
3+
A friendly repository assistant that runs 2 times a day to support contributors and maintainers.
44
Can also be triggered on-demand via '/repo-assist <instructions>' to perform specific tasks.
55
- Labels and triages open issues
66
- Comments helpfully on open issues to unblock contributors and onboard newcomers
@@ -33,6 +33,19 @@ network:
3333
- rust
3434
- java
3535

36+
checkout:
37+
fetch: ["*"] # fetch all remote branches to allow working on PR branches
38+
fetch-depth: 0 # fetch full history
39+
40+
tools:
41+
web-fetch:
42+
github:
43+
toolsets: [all]
44+
min-integrity: none # This workflow is allowed to examine and comment on any issues or PRs
45+
repos: all
46+
bash: true
47+
repo-memory: true
48+
3649
safe-outputs:
3750
add-comment:
3851
max: 10
@@ -65,13 +78,6 @@ safe-outputs:
6578
max: 5
6679
target: "*"
6780

68-
tools:
69-
web-fetch:
70-
github:
71-
toolsets: [all]
72-
bash: true
73-
repo-memory: true
74-
7581
steps:
7682
- name: Fetch repo data for task weighting
7783
env:
@@ -165,7 +171,7 @@ steps:
165171
json.dump(result, f, indent=2)
166172
EOF
167173
168-
source: githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f
174+
source: githubnext/agentics/workflows/repo-assist.md@4957663821dbb3260348084fa2f1659701950fef
169175
---
170176

171177
# Repo Assist

Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
1818
<PackageVersion Include="Suave" Version="2.6.2" />
1919
<PackageVersion Include="System.Memory" Version="4.5.5" />
20-
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
20+
<PackageVersion Include="System.Text.Json" Version="10.0.5" />
2121
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
2222
<PackageVersion Include="NUnit" Version="3.14.0" />
2323
<PackageVersion Include="FsUnit" Version="5.6.0" />
24-
<PackageVersion Include="FSharp.Data" Version="6.3.0" />
24+
<PackageVersion Include="FSharp.Data" Version="8.1.3" />
2525
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
2626
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
2727
<PackageVersion Include="Ionide.KeepAChangelog.Tasks" Version="0.1.8" />
28-
<PackageVersion Include="G-Research.FSharp.Analyzers" Version="0.21.0" />
29-
<PackageVersion Include="Ionide.Analyzers" Version="0.14.11" />
28+
<PackageVersion Include="G-Research.FSharp.Analyzers" Version="0.22.0" />
29+
<PackageVersion Include="Ionide.Analyzers" Version="0.15.0" />
3030
</ItemGroup>
3131
</Project>

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Fixed
66
* Add regression test confirming that types whose name matches their enclosing namespace are correctly included in generated API docs. [#944](https://github.com/fsprojects/FSharp.Formatting/issues/944)
7+
* Fix crash (`failwith "tbd - IndirectImage"`) when `Markdown.ToMd` is called on a document containing reference-style images (e.g. `![alt]\[ref]`). The indirect image is now serialised as `![alt](url)` when the reference is resolved, or `![alt]\[ref]` when it is not. [#1094](https://github.com/fsprojects/FSharp.Formatting/pull/1094)
8+
* Fix `Markdown.ToMd` serialising `*emphasis*` (italic) spans as `**...**` (bold) instead of `*...*`. [#1102](https://github.com/fsprojects/FSharp.Formatting/pull/1102)
9+
* Fix `Markdown.ToMd` serialising ordered list items with 0-based numbering and no period (e.g. `0 first`) instead of 1-based with a period (e.g. `1. first`). [#1102](https://github.com/fsprojects/FSharp.Formatting/pull/1102)
710

811
## 22.0.0-alpha.2 - 2026-03-13
912

src/FSharp.Formatting.Markdown/MarkdownUtils.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ module internal MarkdownUtils =
110110
| DirectLink(body, link, _, _)
111111
| IndirectLink(body, link, _, _) -> "[" + formatSpans ctx body + "](" + link + ")"
112112

113-
| IndirectImage(_body, _, LookupKey ctx.Links (_link, _), _)
114-
| IndirectImage(_body, _link, _, _) -> failwith "tbd - IndirectImage"
115-
| DirectImage(_body, _link, _, _) -> sprintf "![%s](%s)" _body _link
113+
| IndirectImage(body, _, LookupKey ctx.Links (link, _), _) -> sprintf "![%s](%s)" body link
114+
| IndirectImage(body, _, key, _) -> sprintf "![%s][%s]" body key
115+
| DirectImage(body, link, _, _) -> sprintf "![%s](%s)" body link
116116
| Strong(body, _) -> "**" + formatSpans ctx body + "**"
117117
| InlineCode(body, _) -> "`" + body + "`"
118-
| Emphasis(body, _) -> "**" + formatSpans ctx body + "**"
118+
| Emphasis(body, _) -> "*" + formatSpans ctx body + "*"
119119

120120
/// Format a list of MarkdownSpan
121121
and formatSpans ctx spans =
@@ -177,7 +177,7 @@ module internal MarkdownUtils =
177177

178178
for (j, line) in List.indexed lines do
179179
if i = 0 && j = 0 then
180-
yield $"%i{n} " + line
180+
yield $"%i{n + 1}. " + line
181181
else
182182
yield " " + line
183183

tests/FSharp.Markdown.Tests/Markdown.fs

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,3 +1201,173 @@ let ``Paragraph between sublists should not be absorbed into first sublist item
12011201
paragraphPos |> should be (greaterThan firstSublistEnd)
12021202
// Second sublist starts after paragraph.
12031203
secondSublistStart |> should be (greaterThan paragraphPos)
1204+
1205+
// -----------------------------------------------------------------------
1206+
// ToMd serialisation tests
1207+
// These verify the round-trip Markdown-to-Markdown serialiser. Prior to
1208+
// this test file there was zero coverage of Markdown.ToMd.
1209+
// -----------------------------------------------------------------------
1210+
1211+
/// Round-trip helper: parse markdown, serialise back with ToMd (Unix newlines
1212+
/// so comparisons are platform-independent), then strip trailing whitespace.
1213+
let toMd (input: string) =
1214+
Markdown.Parse(input)
1215+
|> (fun doc -> Markdown.ToMd(doc, newline = "\n"))
1216+
|> (fun s -> s.TrimEnd())
1217+
1218+
[<Test>]
1219+
let ``ToMd preserves a plain paragraph`` () =
1220+
"Hello, world." |> toMd |> should contain "Hello, world."
1221+
1222+
[<Test>]
1223+
let ``ToMd preserves a level-1 heading`` () =
1224+
"# Heading One" |> toMd |> shouldEqual "# Heading One"
1225+
1226+
[<Test>]
1227+
let ``ToMd preserves a level-2 heading`` () =
1228+
"## Heading Two" |> toMd |> shouldEqual "## Heading Two"
1229+
1230+
[<Test>]
1231+
let ``ToMd preserves a level-3 heading`` () =
1232+
"### Heading Three" |> toMd |> shouldEqual "### Heading Three"
1233+
1234+
[<Test>]
1235+
let ``ToMd preserves strong (bold) text`` () =
1236+
"**bold**" |> toMd |> should contain "**bold**"
1237+
1238+
[<Test>]
1239+
let ``ToMd preserves inline code`` () =
1240+
"Use `printf` here." |> toMd |> should contain "`printf`"
1241+
1242+
[<Test>]
1243+
let ``ToMd preserves a direct link`` () =
1244+
"[FSharp](https://fsharp.org)"
1245+
|> toMd
1246+
|> should contain "[FSharp](https://fsharp.org)"
1247+
1248+
[<Test>]
1249+
let ``ToMd preserves a direct image`` () =
1250+
"![alt text](image.png)" |> toMd |> should contain "![alt text](image.png)"
1251+
1252+
[<Test>]
1253+
let ``ToMd preserves an unordered list`` () =
1254+
let md = "* apple\n* banana\n* cherry"
1255+
let result = toMd md
1256+
result |> should contain "apple"
1257+
result |> should contain "banana"
1258+
result |> should contain "cherry"
1259+
1260+
[<Test>]
1261+
let ``ToMd preserves emphasis (italic) text`` () =
1262+
// Emphasis must serialise as *...* not **...** (bold)
1263+
"*italic*" |> toMd |> should contain "*italic*"
1264+
1265+
[<Test>]
1266+
let ``ToMd preserves emphasis distinct from strong`` () =
1267+
let result = "**bold** and *italic*" |> toMd
1268+
result |> should contain "**bold**"
1269+
// Emphasis must not be rendered with double asterisks
1270+
result |> should not' (contain "**italic**")
1271+
result |> should contain "*italic*"
1272+
1273+
[<Test>]
1274+
let ``ToMd preserves an ordered list with correct numbering`` () =
1275+
let result = "1. first\n2. second\n3. third" |> toMd
1276+
result |> should contain "1. first"
1277+
result |> should contain "2. second"
1278+
result |> should contain "3. third"
1279+
1280+
[<Test>]
1281+
let ``ToMd ordered list does not use zero-based numbering`` () =
1282+
// Before fix: ordered list items were prefixed "0 ", "1 ", "2 " (0-indexed, no period)
1283+
let result = "1. only item" |> toMd
1284+
result |> should not' (contain "0 only item")
1285+
result |> should contain "1. only item"
1286+
1287+
[<Test>]
1288+
let ``ToMd preserves a fenced code block`` () =
1289+
let md = "```fsharp\nlet x = 1\n```"
1290+
let result = toMd md
1291+
result |> should contain "let x = 1"
1292+
result |> should contain "```"
1293+
1294+
[<Test>]
1295+
let ``ToMd preserves a blockquote`` () =
1296+
let md = "> This is a quote."
1297+
let result = toMd md
1298+
result |> should contain "> "
1299+
result |> should contain "This is a quote."
1300+
1301+
[<Test>]
1302+
let ``ToMd preserves a horizontal rule`` () =
1303+
let md = "Before\n\n---\n\nAfter"
1304+
let result = toMd md
1305+
result |> should contain "Before"
1306+
result |> should contain "---"
1307+
result |> should contain "After"
1308+
1309+
[<Test>]
1310+
let ``ToMd preserves LaTeX inline math`` () =
1311+
let md = "Einstein's $E = mc^2$ equation."
1312+
let result = toMd md
1313+
result |> should contain "$E = mc^2$"
1314+
1315+
[<Test>]
1316+
let ``ToMd preserves inline HTML block`` () =
1317+
let md = "<div class=\"note\">Note content</div>"
1318+
let result = toMd md
1319+
result |> should contain "<div"
1320+
result |> should contain "Note content"
1321+
1322+
[<Test>]
1323+
let ``ToMd handles a document with heading and paragraph`` () =
1324+
let md = "# Title\n\nBody text here."
1325+
let result = toMd md
1326+
result |> should contain "# Title"
1327+
result |> should contain "Body text here."
1328+
1329+
[<Test>]
1330+
let ``ToMd handles a table`` () =
1331+
let md = "Col1 | Col2\n:--- | :---\nA | B"
1332+
let result = toMd md
1333+
result |> should contain "Col1"
1334+
result |> should contain "Col2"
1335+
result |> should contain "A"
1336+
result |> should contain "B"
1337+
1338+
[<Test>]
1339+
let ``ToMd handles empty document`` () = "" |> toMd |> shouldEqual ""
1340+
1341+
[<Test>]
1342+
let ``ToMd preserves an indirect link when key is not resolved`` () =
1343+
// Indirect link whose reference definition is present — should round-trip
1344+
let md = "[link text][ref]\n\n[ref]: https://example.com"
1345+
let result = toMd md
1346+
// ToMd resolves the indirect link to a direct link form
1347+
result |> should contain "[link text]"
1348+
result |> should contain "https://example.com"
1349+
1350+
// --------------------------------------------------------------------------------------
1351+
// ToMd round-trip: indirect images (issue - failwith "tbd - IndirectImage")
1352+
// --------------------------------------------------------------------------------------
1353+
1354+
[<Test>]
1355+
let ``ToMd round-trip: indirect image with resolved reference`` () =
1356+
// Markdown with a reference-style image and a reference definition
1357+
let input = "![alt text][img-id]\n\n[img-id]: http://example.com/image.png \"Title\""
1358+
let doc = Markdown.Parse(input)
1359+
// Should NOT throw (was failing with failwith "tbd - IndirectImage")
1360+
let result = Markdown.ToMd(doc)
1361+
// When key is resolved, should render as a direct image
1362+
result |> should contain "![alt text]("
1363+
result |> should contain "http://example.com/image.png"
1364+
1365+
[<Test>]
1366+
let ``ToMd round-trip: indirect image with unresolved reference`` () =
1367+
// Parse just the image token without a reference definition
1368+
let input = "![alt text][unknown-ref]"
1369+
let doc = Markdown.Parse(input)
1370+
// Should NOT throw (was failing with failwith "tbd - IndirectImage")
1371+
let result = Markdown.ToMd(doc)
1372+
// When key is not resolved, should preserve the indirect form
1373+
result |> should contain "![alt text][unknown-ref]"

0 commit comments

Comments
 (0)